public static void Run()
        {
            // ExStart:GrayscalingOnDICOM
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_DICOM();

            // Load an existing image.
            using (DicomImage image = new DicomImage(dataDir + "image.dcm"))
            {
                // Transform image to its grayscale representation and Save the resultant image.
                image.Grayscale();
                image.Save(dataDir + "GrayscalingOnDICOM_out.bmp", new BmpOptions());
            }
            // ExEnd:GrayscalingOnDICOM
        }
 public static void Run()
 {
     // ExStart:GrayscalingOnDICOM
     // The path to the documents directory.
     string dataDir = RunExamples.GetDataDir_DICOM();
    
     // Load an existing image.
     using (DicomImage image = new DicomImage(dataDir + "image.dcm"))
     {
         // Transform image to its grayscale representation and Save the resultant image.
         image.Grayscale();
         image.Save(dataDir + "GrayscalingOnDICOM_out.bmp", new BmpOptions());
     }
     // ExEnd:GrayscalingOnDICOM
 }
        public static void Run()
        {
            //ExStart:GrayscalingOnDICOM
            // 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))
            {
                // Transform image to its grayscale representation and Save the resultant image.
                image.Grayscale();
                image.Save(dataDir + "GrayscalingOnDICOM_out.bmp", new BmpOptions());
            }
            //ExEnd:GrayscalingOnDICOM
        }