Convert dicom to png
Contents
[
Hide
]
Using Aspose.Imaging we can convert DICOM image to Png.
The following code snippet shows you how to convert DICOM to Png.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Aspose.Imaging; | |
using Aspose.Imaging.FileFormats.Tiff.Enums; | |
using Aspose.Imaging.ImageOptions; | |
using System; | |
using System.IO; | |
string templatesFolder = @"c:\Users\USER\Downloads\templates\"; | |
string dataDir = templatesFolder; | |
using (Aspose.Imaging.FileFormats.Dicom.DicomImage image = | |
(Aspose.Imaging.FileFormats.Dicom.DicomImage)Image.Load(dataDir + "template.dicom")) | |
{ | |
PngOptions options = new PngOptions(); | |
image.Save(dataDir + "result.png", options); | |
} | |
File.Delete(dataDir + "result.png"); |