Convert dicom to jpg python10/12/2023 String FilesPath = Server.MapPath( " Dtest") Public List uploadAndSaveZipFile(HttpPostedFileBase objFile) ObjModel=uploadAndSaveZipFile(filePosted) Public ActionResult UploadZip(HttpPostedFileBase filePosted) // GET: /DicomSlider/ public ActionResult Index() Public class DicomSliderController : Controller You will see how this folder is used to store images at the controller level so let's look at the Controller Code, basically we will look at the " UploadZip" action. You can see an img tag there having the src pointing to " DICOMIMG" folder which resides in our root project files. We have a Div under the form element, this div will be responsible to show the converted files. So when you click submit button, the form posted to this action with the selected files in file upload control. It has a from which is being post at " UploadZip" action of " DicomSlider" controller. So you can see this view is having a model of list type, this list will be responsible for showing the converted images. The view is very simple having only a browse button to upload the zip of Dicom files and after submit, it will show the converted = " (Html.BeginForm( " UploadZip", " DicomSlider",įormMethod.Post, new )) It displays the images which are converted from Dicom format to JPEG. So basically, this project has a view which is capable of uploading a zip file and this same view also shows the result of zip processing. I am posting the full project here so you can find those DLLs in project's bin folder named: " dicom.dll and ". You will need two DLLs to copy in your project to make this code work. It is a simple MVC project without Authentication having a single controller and two actions and a single view. Now let's look at what exactly is being done at code level to achieve this. After clicking submit button, it will process each file of zip folder and convert it to jpeg file and show you on the same Index page. You will see a file upload control, click the browse button and browse to project folder itself, it has a folder named " Sample Files", open this folder you will find a zip file, select it and click on submit button. ![]() It will show you the Index page of DicomSlider Controller. Open this project using Visual Studio 2012 or 2013 and run it. Backgroundĭevelopers having knowledge of Dicom or having challenges regarding Dicom library would find it interesting. So I created a project which can convert any Dicom file (with or without extension) to standard image format. ![]() Though there are many projects on the internet depicting conversion of Dicom files to Standard image formats (Code Project also has an aritcle), none of the projects fulfilled my requirements because some use deprecated DLLs or some are bounded with the Dicom extension (. ![]() There are many software available which can show Dicom images but it was a web application and browser doesn't understand DICOM format, so I had to process the uploaded zip and convert each DICOM file to Jpeg format and show these on the browser. First of all, by writing this article, I am celebrating my success on my assignment to handle Dicom files in MVC.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |