Представляет кадр DICOM.
Вот C#/VB.NET код, который демонстрирует, как получить изображение кадра DICOM и сохранить его в виде файла PNG.
''' <summary>
''' Returns 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.DicomPage = dicomFile.Pages(pageIndex)
' get DICOM image
Using image As Vintasoft.Imaging.VintasoftImage = page.GetImage()
' save image to a PNG file
image.Save("E:\DicomImage.png")
End Using
End Using
End Sub
/// <summary>
/// Returns 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.DicomPage page = dicomFile.Pages[pageIndex];
// get DICOM image
using (Vintasoft.Imaging.VintasoftImage image = page.GetImage())
{
// save image to a PNG file
image.Save(@"E:\DicomImage.png");
}
}
}
Целевые платформы: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5