public static void Run() { // ExStart:DitheringForDICOMImage // The path to the documents directory. string dataDir = RunExamples.GetDataDir_DICOM(); // Load an existing image. using (DicomImage image = new DicomImage(dataDir + "image.dcm")) { // Peform Threshold dithering on the image and Save the resultant image. image.Dither(DitheringMethod.ThresholdDithering, 1); image.Save(dataDir + "DitheringForDICOMImage_out.bmp", new BmpOptions()); } // ExEnd:DitheringForDICOMImage }
public static void Run() { //ExStart:DitheringForDICOMImage // The path to the documents directory. string dataDir = RunExamples.GetDataDir_DICOM(); using (var fileStream = new FileStream(dataDir + "file.dcm", FileMode.Open, FileAccess.Read)) using (DicomImage image = new DicomImage(fileStream)) { // Peform Threshold dithering on the image and Save the resultant image. image.Dither(DitheringMethod.ThresholdDithering, 1); image.Save(dataDir + "DitheringForDICOMImage_out.bmp", new BmpOptions()); } //ExEnd:DitheringForDICOMImage }