VintaSoft Imaging .NET SDK v8.6
Vintasoft.Imaging.Codecs.ImageFiles.Dicom Namespace / DicomFrame Class
Members Example



In This Topic
    DicomFrame Class
    In This Topic
    Represents a DICOM frame.
    Object Model
    DicomFrame ClassDicomImageVoiLut ClassDicomImageModalityLut ClassDicomOverlayImage ClassPalette ClassResolution StructureImageFileSource ClassDicomImageVoiLut Class
    Syntax
    'Declaration
     
    Public NotInheritable Class DicomFrame 
       Inherits Vintasoft.Imaging.Codecs.ImageFiles.ImagePage
    public sealed class DicomFrame : Vintasoft.Imaging.Codecs.ImageFiles.ImagePage 
    public __gc __sealed class DicomFrame : public Vintasoft.Imaging.Codecs.ImageFiles.ImagePage 
    public ref class DicomFrame sealed : public Vintasoft.Imaging.Codecs.ImageFiles.ImagePage 
    Example
    This example demonstrates how to get an image of DICOM frame and save it as PNG file.
    ''' <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
    /// <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");
        }
    }
    Inheritance Hierarchy

    System.Object
       Vintasoft.Imaging.Codecs.ImageFiles.ImageFileBlock
          Vintasoft.Imaging.Codecs.ImageFiles.ImagePage
             Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFrame

    Requirements

    Target Platforms: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also