VintaSoft Imaging .NET SDK v8.7
In This Topic
    DICOM: Working with DICOM files
    In This Topic

    Digital Imaging and Communications in Medicine (DICOM) is the standard for the communication and management of medical imaging information and related data. DICOM standard includes a file format definition and a network communications protocol.

    VintaSoft DICOM .NET Plug-in has a set of classes which allows to get images and patient data from DICOM files very easily.

    DicomFile class

    DicomFile class allows to:
    Here is an example that shows how to get patient information (metadata) from DICOM file:
    ' The project, which uses this code, must have references to the following assemblies:
    ' - Vintasoft.Imaging
    ' - Vintasoft.Imaging.Dicom
    
    ''' <summary>
    ''' Gets and prints information about DICOM file.
    ''' </summary>
    ''' <param name="filePath">Path to a DICOm file.</param>
    Public Sub GetDicomFileInfo(filePath As String)
            ' open DICOM file
            Using file As New Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFile(filePath)
                    ' show file name and page count
                    System.Console.WriteLine("File: {0} Page count: {1}", System.IO.Path.GetFileName(filePath), file.Pages.Count)
                    System.Console.WriteLine()
    
                    ' get DICOM file metadata
                    Dim fileMetadata As New Vintasoft.Imaging.Metadata.DicomFrameMetadata(file)
    
                    ' for each metadata node
                    For Each children As Vintasoft.Imaging.Metadata.DicomDataElementMetadata In fileMetadata
                            System.Console.WriteLine()
                            ' print information about metadata node
                            PrintMetadataNodeInfo(children)
                    Next
            End Using
    End Sub
    
    ''' <summary>
    ''' Prints information about metadata node.
    ''' </summary>
    ''' <param name="node">Metadata node.</param>
    Public Sub PrintMetadataNodeInfo(node As Vintasoft.Imaging.Metadata.MetadataNode)
            ' if node is DicomDataElementMetadata
            If TypeOf node Is Vintasoft.Imaging.Metadata.DicomDataElementMetadata Then
                    Dim dataElementMetadata As Vintasoft.Imaging.Metadata.DicomDataElementMetadata = DirectCast(node, Vintasoft.Imaging.Metadata.DicomDataElementMetadata)
                    System.Console.CursorLeft += 4
                    ' show data element info
                    System.Console.WriteLine("({0},{1}) {2} {3}", dataElementMetadata.GroupNumber, dataElementMetadata.ElementNumber, dataElementMetadata.Name, dataElementMetadata.Value)
            End If
    
            ' show children info
            For Each children As Vintasoft.Imaging.Metadata.MetadataNode In node
                    PrintMetadataNodeInfo(children)
            Next
    End Sub
    
    ' This code example produces the following output:
    '
    '        File: brain_005.dcm Pages count: 1
    '
    '
    '        Group: FileMetaInformation
    '            (2,1) File Meta Information Version 0 1
    '            (2,2) Media Storage SOP Class UID MR Image Storage
    '            (2,3) Media Storage SOP Instance UID 0.0.0.0.1.8811.2.5.20010413115754.12432
    '            (2,16) Transfer Syntax UID Explicit VR Little Endian
    '            (2,18) Implementation Class UID 0.0.0.0
    '            (2,19) Implementation Version Name NOTSPECIFIED
    '            (2,22) Source Application Entity Title NOTSPECIFIED
    '
    '        Group: Identifying
    '            (8,8) Image Type ORIGINAL PRIMARY MPR
    '            (8,22) SOP Class UID MR Image Storage
    '            (8,24) SOP Instance UID 0.0.0.0.1.8811.2.5.20010413115754.12432
    '            (8,32) Study Date 16.03.2001 0:00:00
    '            (8,33) Series Date 16.03.2001 0:00:00
    '            (8,34) Acquisition Date 16.03.2001 0:00:00
    '            (8,35) Content Date 23.03.2001 0:00:00
    '            (8,48) Study Time 14:30:08
    '            (8,49) Series Time 14:34:14
    '            (8,50) Acquisition Time 14:34:15
    '            (8,51) Content Time 14:30:10
    '            (8,80) Accession Number
    '            (8,96) Modality MR
    '            (8,112) Manufacturer GE Medical Systems
    '            (8,128) Institution Name
    '            (8,144) Referring Physician's Name
    '            (8,4112) Station Name MRS1
    '            (8,4144) Study Description BRAIN
    '            (8,4158) Series Description FSE PD AXIAL OBL
    '            (8,4176) Performing Physician's Name
    '            (8,4208) Operators' Name EC
    '            (8,4240) Manufacturer's Model Name SIGNA
    '
    '        Group: Patient
    '            (16,16) Patient's Name
    '            (16,32) Patient ID 123565
    '            (16,48) Patient's Birth Date 01.01.0001 0:00:00
    '            (16,64) Patient's Sex F
    '            (16,4112) Patient's Age 028Y
    '            (16,4144) Patient's Weight 61,235
    '            (16,8624) Additional Patient History
    '
    '        Group: Acquisition
    '            (24,32) Scanning Sequence SE
    '            (24,33) Sequence Variant SK
    '            (24,34) Scan Options SP
    '            (24,35) MR Acquisition Type 2D
    '            (24,36) Sequence Name fse
    '            (24,80) Slice Thickness 5
    '            (24,128) Repetition Time 2300
    '            (24,129) Echo Time 22
    '            (24,131) Number of Averages 1
    '            (24,132) Imaging Frequency 63,8615
    '            (24,134) Echo Number(s) 1
    '            (24,135) Magnetic Field Strength 1,5
    '            (24,136) Spacing Between Slices 2
    '            (24,137) Number of Phase Encoding Steps 256
    '            (24,145) Echo Train Length 8
    '            (24,149) Pixel Bandwidth 31,25
    '            (24,4128) Software Version(s) 3
    '            (24,4144) Protocol Name CLINICAL BRAIN
    '            (24,4232) Heart Rate 0
    '            (24,4240) Cardiac Number of Images 0
    '            (24,4244) Trigger Window 0
    '            (24,4352) Reconstruction Diameter 220
    '            (24,4688) Receive Coil Name HEAD
    '            (24,4880) Acquisition Matrix 0 256 256 0
    '            (24,4882) In-plane Phase Encoding Direction ROW
    '            (24,4884) Flip Angle 90
    '            (24,4886) SAR 0,0313309
    '            (24,20736) Patient Position HFS
    '
    '        Group: Relationship
    '            (32,13) Study Instance UID 0.0.0.0.2.8811.20010413115754.12432
    '            (32,14) Series Instance UID 0.0.0.0.3.8811.2.20010413115754.12432
    '            (32,16) Study ID 8811
    '            (32,17) Series Number 2
    '            (32,18) Acquisition Number 31748
    '            (32,19) Instance Number 5
    '            (32,32) Patient Orientation L PH
    '            (32,48) Image Position -110,5 -82,1063 -44,9575
    '            (32,50) Image Position (Patient) -110,5 -82,1063 -44,9575
    '            (32,53) Image Orientation 1 0 0 0 0,99096 0,134158
    '            (32,55) Image Orientation (Patient) 1 0 0 0 0,99096 0,134158
    '            (32,82) Frame of Reference UID 0.0.0.0.4.8811.2.20010413115754.12432
    '            (32,4098) Images in Acquisition 1
    '            (32,4160) Position Reference Indicator NA
    '            (32,4161) Slice Location -30,2
    '
    '        Group: ImageInformation
    '            (40,2) Samples per Pixel 1
    '            (40,4) Photometric Interpretation MONOCHROME2
    '            (40,16) Rows 256
    '            (40,17) Columns 256
    '            (40,48) Pixel Spacing 0,859375 0,859375
    '            (40,256) Bits Allocated 16
    '            (40,257) Bits Stored 16
    '            (40,258) High Bit 15
    '            (40,259) Pixel Representation 1
    '            (40,262) Smallest Image Pixel Value 0
    '            (40,263) Largest Image Pixel Value 932
    '            (40,288) Pixel Padding Value 0
    '            (40,4176) Window Center 0
    '            (40,4177) Window Width 0
    '            (40,4178) Rescale Intercept 0
    '            (40,4179) Rescale Slope 1
    '            (40,4180) Rescale Type SIGNAL INTENSITY (UNITLESS)
    '
    '        Group: RawData
    '            (32736,16) Pixel Data 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
    '
    
                  
    
    // The project, which uses this code, must have references to the following assemblies:
    // - Vintasoft.Imaging
    // - Vintasoft.Imaging.Dicom
    
    /// <summary>
    /// Gets and prints information about DICOM file.
    /// </summary>
    /// <param name="filePath">Path to a DICOm file.</param>
    public void GetDicomFileInfo(string filePath)
    {
        // open DICOM file
        using (Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFile file = 
            new Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFile(filePath))
        {
            // show file name and page count
            System.Console.WriteLine("File: {0} Page count: {1}", 
                System.IO.Path.GetFileName(filePath), file.Pages.Count);
            System.Console.WriteLine();
    
            // get DICOM file metadata
            Vintasoft.Imaging.Metadata.DicomFrameMetadata fileMetadata = 
                new Vintasoft.Imaging.Metadata.DicomFrameMetadata(file);
    
            // for each metadata node
            foreach (Vintasoft.Imaging.Metadata.DicomDataElementMetadata children in fileMetadata)
            {
                System.Console.WriteLine();
                // print information about metadata node
                PrintMetadataNodeInfo(children);
            }
        }
    }
    
    /// <summary>
    /// Prints information about metadata node.
    /// </summary>
    /// <param name="node">Metadata node.</param>
    public void PrintMetadataNodeInfo(Vintasoft.Imaging.Metadata.MetadataNode node)
    {
        // if node is DicomDataElementMetadata
        if (node is Vintasoft.Imaging.Metadata.DicomDataElementMetadata)
        {
            Vintasoft.Imaging.Metadata.DicomDataElementMetadata dataElementMetadata = 
                (Vintasoft.Imaging.Metadata.DicomDataElementMetadata)node;
            System.Console.CursorLeft += 4;
            // show data element info
            System.Console.WriteLine("({0},{1}) {2} {3}",
                dataElementMetadata.GroupNumber,
                dataElementMetadata.ElementNumber,
                dataElementMetadata.Name,
                dataElementMetadata.Value);
        }
    
        // show children info
        foreach (Vintasoft.Imaging.Metadata.MetadataNode children in node)
            PrintMetadataNodeInfo(children);
    }
    
    /* This code example produces the following output:
    
    File: brain_005.dcm Pages count: 1
    
    
    Group: FileMetaInformation
        (2,1) File Meta Information Version 0 1
        (2,2) Media Storage SOP Class UID MR Image Storage
        (2,3) Media Storage SOP Instance UID 0.0.0.0.1.8811.2.5.20010413115754.12432
        (2,16) Transfer Syntax UID Explicit VR Little Endian
        (2,18) Implementation Class UID 0.0.0.0
        (2,19) Implementation Version Name NOTSPECIFIED
        (2,22) Source Application Entity Title NOTSPECIFIED
    
    Group: Identifying
        (8,8) Image Type ORIGINAL PRIMARY MPR
        (8,22) SOP Class UID MR Image Storage
        (8,24) SOP Instance UID 0.0.0.0.1.8811.2.5.20010413115754.12432
        (8,32) Study Date 16.03.2001 0:00:00
        (8,33) Series Date 16.03.2001 0:00:00
        (8,34) Acquisition Date 16.03.2001 0:00:00
        (8,35) Content Date 23.03.2001 0:00:00
        (8,48) Study Time 14:30:08
        (8,49) Series Time 14:34:14
        (8,50) Acquisition Time 14:34:15
        (8,51) Content Time 14:30:10
        (8,80) Accession Number
        (8,96) Modality MR
        (8,112) Manufacturer GE Medical Systems
        (8,128) Institution Name
        (8,144) Referring Physician's Name
        (8,4112) Station Name MRS1
        (8,4144) Study Description BRAIN
        (8,4158) Series Description FSE PD AXIAL OBL
        (8,4176) Performing Physician's Name
        (8,4208) Operators' Name EC
        (8,4240) Manufacturer's Model Name SIGNA
    
    Group: Patient
        (16,16) Patient's Name
        (16,32) Patient ID 123565
        (16,48) Patient's Birth Date 01.01.0001 0:00:00
        (16,64) Patient's Sex F
        (16,4112) Patient's Age 028Y
        (16,4144) Patient's Weight 61,235
        (16,8624) Additional Patient History
    
    Group: Acquisition
        (24,32) Scanning Sequence SE
        (24,33) Sequence Variant SK
        (24,34) Scan Options SP
        (24,35) MR Acquisition Type 2D
        (24,36) Sequence Name fse
        (24,80) Slice Thickness 5
        (24,128) Repetition Time 2300
        (24,129) Echo Time 22
        (24,131) Number of Averages 1
        (24,132) Imaging Frequency 63,8615
        (24,134) Echo Number(s) 1
        (24,135) Magnetic Field Strength 1,5
        (24,136) Spacing Between Slices 2
        (24,137) Number of Phase Encoding Steps 256
        (24,145) Echo Train Length 8
        (24,149) Pixel Bandwidth 31,25
        (24,4128) Software Version(s) 3
        (24,4144) Protocol Name CLINICAL BRAIN
        (24,4232) Heart Rate 0
        (24,4240) Cardiac Number of Images 0
        (24,4244) Trigger Window 0
        (24,4352) Reconstruction Diameter 220
        (24,4688) Receive Coil Name HEAD
        (24,4880) Acquisition Matrix 0 256 256 0
        (24,4882) In-plane Phase Encoding Direction ROW
        (24,4884) Flip Angle 90
        (24,4886) SAR 0,0313309
        (24,20736) Patient Position HFS
    
    Group: Relationship
        (32,13) Study Instance UID 0.0.0.0.2.8811.20010413115754.12432
        (32,14) Series Instance UID 0.0.0.0.3.8811.2.20010413115754.12432
        (32,16) Study ID 8811
        (32,17) Series Number 2
        (32,18) Acquisition Number 31748
        (32,19) Instance Number 5
        (32,32) Patient Orientation L PH
        (32,48) Image Position -110,5 -82,1063 -44,9575
        (32,50) Image Position (Patient) -110,5 -82,1063 -44,9575
        (32,53) Image Orientation 1 0 0 0 0,99096 0,134158
        (32,55) Image Orientation (Patient) 1 0 0 0 0,99096 0,134158
        (32,82) Frame of Reference UID 0.0.0.0.4.8811.2.20010413115754.12432
        (32,4098) Images in Acquisition 1
        (32,4160) Position Reference Indicator NA
        (32,4161) Slice Location -30,2
    
    Group: ImageInformation
        (40,2) Samples per Pixel 1
        (40,4) Photometric Interpretation MONOCHROME2
        (40,16) Rows 256
        (40,17) Columns 256
        (40,48) Pixel Spacing 0,859375 0,859375
        (40,256) Bits Allocated 16
        (40,257) Bits Stored 16
        (40,258) High Bit 15
        (40,259) Pixel Representation 1
        (40,262) Smallest Image Pixel Value 0
        (40,263) Largest Image Pixel Value 932
        (40,288) Pixel Padding Value 0
        (40,4176) Window Center 0
        (40,4177) Window Width 0
        (40,4178) Rescale Intercept 0
        (40,4179) Rescale Slope 1
        (40,4180) Rescale Type SIGNAL INTENSITY (UNITLESS)
    
    Group: RawData
        (32736,16) Pixel Data 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
    */
                    
    



    DicomDataSet class

    DicomDataSet class allows to:

    DicomDataElement class

    DicomDataElement class allows to:

    DicomFrameCollection class

    DicomFrameCollection class allows to:

    DicomFrame class

    DicomFrame class allows to:
    Here is an example that shows how to get an image of DICOM frame and save it to a PNG file:
    ' The project, which uses this code, must have references to the following assemblies:
    ' - Vintasoft.Imaging
    ' - Vintasoft.Imaging.Dicom
    
    ''' <summary>
    ''' Gets an image of DICOM frame and saves image to a PNG file.
    ''' </summary>
    ''' <param name="filePath">Path to a DICOM file.</param>
    ''' <param name="pageIndex">Index of DICOM page.</param>
    Public Sub GetAndSaveDicomImage(filePath As String, pageIndex As Integer)
            ' open DICOM file
            Using dicomFile As New Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFile(filePath)
                    ' get DICOM page
                    Dim page As Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFrame = dicomFile.Pages(pageIndex)
                    ' get DICOM image
                    Dim image As Vintasoft.Imaging.VintasoftImage = page.GetImage()
                    ' save image to a PNG file
                    image.Save("E:\DicomImage.png")
            End Using
    End Sub
                  
    
    // The project, which uses this code, must have references to the following assemblies:
    // - Vintasoft.Imaging
    // - Vintasoft.Imaging.Dicom
    
    /// <summary>
    /// Gets an image of DICOM frame and saves image to a PNG file.
    /// </summary>
    /// <param name="filePath">Path to a DICOM file.</param>
    /// <param name="pageIndex">Index of DICOM page.</param>
    public void GetAndSaveDicomImage(string filePath, int pageIndex)
    {
        // open DICOM file
        using (Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFile dicomFile =
            new Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFile(filePath))
        {
            // get DICOM page
            Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFrame page = dicomFile.Pages[pageIndex];
            // get DICOM image
            Vintasoft.Imaging.VintasoftImage image = page.GetImage();
            // save image to a PNG file
            image.Save(@"E:\DicomImage.png");
        }
    }
                    
    


    Here is an example that shows how to get DICOM image with overlay objects and save it to a PNG file:
    ' The project, which uses this code, must have references to the following assemblies:
    ' - Vintasoft.Imaging
    ' - Vintasoft.Imaging.Dicom
    
    ''' <summary>
    ''' Gets DICOM image with overlay objects and saves it to a PNG file.
    ''' </summary>
    ''' <param name="filePath">Path to DICOM file.</param>
    ''' <param name="pageIndex">Index of DICOM page.</param>
    Public Sub GetAndSaveDicomImageWithOverlays(filePath As String, pageIndex As Integer)
            ' open DICOM file
            Using dicomFile As New Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFile(filePath)
                    ' get DICOM page
                    Dim page As Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFrame = dicomFile.Pages(pageIndex)
                    ' return DICOM image with overlay objects
                    Dim image As Vintasoft.Imaging.VintasoftImage = page.GetImage(Nothing, True, Nothing)
                    ' save image to a PNG file
                    image.Save("E:\DicomImage.png")
            End Using
    End Sub
                  
    
    // The project, which uses this code, must have references to the following assemblies:
    // - Vintasoft.Imaging
    // - Vintasoft.Imaging.Dicom
    
    /// <summary>
    /// Gets DICOM image with overlay objects and saves it to a PNG file.
    /// </summary>
    /// <param name="filePath">Path to DICOM file.</param>
    /// <param name="pageIndex">Index of DICOM page.</param>
    public void GetAndSaveDicomImageWithOverlays(string filePath, int pageIndex)
    {
        // open DICOM file
        using (Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFile dicomFile =
            new Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFile(filePath))
        {
            // get DICOM page
            Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFrame page = dicomFile.Pages[pageIndex];
            // return DICOM image with overlay objects
            Vintasoft.Imaging.VintasoftImage image = page.GetImage(null, true, null);
            // save image to a PNG file
            image.Save(@"E:\DicomImage.png");
        }
    }
                    
    


    Here is an example that shows how to get raw DICOM image, apply VOI LUT to the DICOM image, draw overlay objects on the DICOM image and save DICOM image to a PNG file:
    ' The project, which uses this code, must have references to the following assemblies:
    ' - Vintasoft.Imaging
    ' - Vintasoft.Imaging.Dicom
    
    ''' <summary>
    ''' Gets raw DICOM image, applies a VOI LUT to the DICOM image,
    ''' draws the overlay objects to the DICOM image, saves DICOM image to a PNG file.
    ''' </summary>
    ''' <param name="filePath">Path to DICOM file.</param>
    ''' <param name="pageIndex">Index of DICOM page.</param>
    Public Sub GetAndSaveDicomImageWithOverlaysAndAdjustImageWindow(filePath As String, pageIndex As Integer)
            ' open DICOM file
            Using dicomFile As New Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFile(filePath)
                    ' get DICOM page
                    Dim page As Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFrame = dicomFile.Pages(pageIndex)
    
    
                    ' get raw DICOM image
    
                    ' create settings for decoding DICOM image
                    Dim decodingSettings As New Vintasoft.Imaging.Codecs.Decoders.DicomDecodingSettings()
                    ' specify that Modality LUT should not be applied to a DICOM image
                    decodingSettings.ApplyModalityLut = False
                    ' specify that VOI LUT should not be applied to a DICOM image
                    decodingSettings.ApplyValueOfInterestLut = False
                    ' specify that overlay objects should not be drawn on DICOM image
                    decodingSettings.ShowOverlayImages = False
                    ' get raw DICOM image
                    Dim image As Vintasoft.Imaging.VintasoftImage = page.GetImage(decodingSettings, Nothing)
    
    
                    ' apply VOI LUT to the DICOM image
    
                    Dim applyDicomImageVoiLutCommand As New Vintasoft.Imaging.ImageProcessing.ApplyDicomImageVoiLutCommand()
                    applyDicomImageVoiLutCommand.VoiLut = New Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomImageVoiLookupTable(128, 50)
                    applyDicomImageVoiLutCommand.ExecuteInPlace(image)
    
    
                    ' draw overlay objects on DICOM image
    
                    Dim applyDicomOverlaysCommand As New Vintasoft.Imaging.ImageProcessing.ApplyDicomOverlaysCommand()
                    applyDicomOverlaysCommand.OverlayImages = page.OverlayImages
                    applyDicomOverlaysCommand.OverlayColor = New Vintasoft.Imaging.ImageColors.Rgb24Color(180, 180, 180)
                    applyDicomOverlaysCommand.ExecuteInPlace(image)
    
    
                    ' save image to a PNG file
                    image.Save("E:\DicomImage.png")
            End Using
    End Sub
                  
    
    // The project, which uses this code, must have references to the following assemblies:
    // - Vintasoft.Imaging
    // - Vintasoft.Imaging.Dicom
    
    /// <summary>
    /// Gets raw DICOM image, applies a VOI LUT to the DICOM image,
    /// draws the overlay objects to the DICOM image, saves DICOM image to a PNG file.
    /// </summary>
    /// <param name="filePath">Path to DICOM file.</param>
    /// <param name="pageIndex">Index of DICOM page.</param>
    public void GetAndSaveDicomImageWithOverlaysAndAdjustImageWindow(string filePath, int pageIndex)
    {
        // open DICOM file
        using (Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFile dicomFile =
            new Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFile(filePath))
        {
            // get DICOM page
            Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFrame page = dicomFile.Pages[pageIndex];
    
    
            // get raw DICOM image
    
            // create settings for decoding DICOM image
            Vintasoft.Imaging.Codecs.Decoders.DicomDecodingSettings decodingSettings =
                new Vintasoft.Imaging.Codecs.Decoders.DicomDecodingSettings();
            // specify that Modality LUT should not be applied to a DICOM image
            decodingSettings.ApplyModalityLut = false;
            // specify that VOI LUT should not be applied to a DICOM image
            decodingSettings.ApplyValueOfInterestLut = false;
            // specify that overlay objects should not be drawn on DICOM image
            decodingSettings.ShowOverlayImages = false;
            // get raw DICOM image
            Vintasoft.Imaging.VintasoftImage image = page.GetImage(decodingSettings, null);
    
    
            // apply VOI LUT to the DICOM image
    
            Vintasoft.Imaging.ImageProcessing.ApplyDicomImageVoiLutCommand applyDicomImageVoiLutCommand =
                new Vintasoft.Imaging.ImageProcessing.ApplyDicomImageVoiLutCommand();
            applyDicomImageVoiLutCommand.VoiLut = new Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomImageVoiLookupTable(128, 50);
            applyDicomImageVoiLutCommand.ExecuteInPlace(image);
    
    
            // draw overlay objects on DICOM image
    
            Vintasoft.Imaging.ImageProcessing.ApplyDicomOverlaysCommand applyDicomOverlaysCommand =
                new Vintasoft.Imaging.ImageProcessing.ApplyDicomOverlaysCommand();
            applyDicomOverlaysCommand.OverlayImages = page.OverlayImages;
            applyDicomOverlaysCommand.OverlayColor = new Vintasoft.Imaging.ImageColors.Rgb24Color(180, 180, 180);
            applyDicomOverlaysCommand.ExecuteInPlace(image);
    
    
            // save image to a PNG file
            image.Save(@"E:\DicomImage.png");
        }
    }