VintaSoft Imaging .NET SDK 14.0: Документация для .NET разработчика
Vintasoft.Imaging.Codecs.Encoders Namespace / DicomEncoderSettings Class
Члены типа Объект Синтаксис Example Иерархия Требования Смотрите также
В этом разделе
    Класс DicomEncoderSettings
    В этом разделе
    Содержит настройки энкодера DICOM.
    Объектная модель
    DicomEncoderSettings
    Синтаксис
    'Declaration
    
    <TypeConverterAttribute(Vintasoft.Imaging.TypeConverters.SimpleTypeConverter)>
    Public Class DicomEncoderSettings
       Inherits EncoderSettings
    
    
    [TypeConverter(Vintasoft.Imaging.TypeConverters.SimpleTypeConverter)]
    public class DicomEncoderSettings : EncoderSettings
    
    
    [TypeConverter(Vintasoft.Imaging.TypeConverters.SimpleTypeConverter)]
    public __gc class DicomEncoderSettings : public EncoderSettings*
    
    
    [TypeConverter(Vintasoft.Imaging.TypeConverters.SimpleTypeConverter)]
    public ref class DicomEncoderSettings : public EncoderSettings^
    
    
    Пример

    Этот C#/VB.NET код показывает, как загрузить изображения DICOM из файла DICOM, прожечь наложенные изображения на изображения DICOM и сохранить измененные изображения DICOM в новый файл DICOM с сжатием.

    
    ''' <summary>
    ''' Loads DICOM images from DICOM file, burns the overlay images on DICOM images and saves changed DICOM images to a new DICOM file with compression.
    ''' </summary>
    ''' <param name="sourceFilePath">A path to a source DICOM file.</param>
    ''' <param name="destFilePath">A path to the destination DICOM file.</param>
    Public Shared Sub BurnOverlayImagesAndSaveToDicomFile(sourceFilePath As String, destFilePath As String)
        ' create image collection
        Using images As New Vintasoft.Imaging.ImageCollection()
            ' open DICOM file
            images.Add(sourceFilePath)
    
            Try
                ' create DICOM decoding settings
                Dim decodingSettings As New Vintasoft.Imaging.Codecs.Decoders.DicomDecodingSettings()
                ' specify that DICOM decoder needs to draw overlay images on DICOM image
                decodingSettings.ShowOverlayImages = True
                ' set the DICOM decoding settings for all images in image collection
                images.SetDecodingSettings(decodingSettings)
    
                ' for each image in image collection
                For Each image As Vintasoft.Imaging.VintasoftImage In images
                    ' convert image to BGR24-image
                    image.ConvertToBgr24()
                Next
    
                ' create DICOM encoder settings with RLE compression
                Dim dicomEncoderSettings As New Vintasoft.Imaging.Codecs.Encoders.DicomEncoderSettings(Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomImageCompressionType.RLE)
    
                ' create DICOM encoder with compression settings
                Using encoder As New Vintasoft.Imaging.Codecs.Encoders.DicomEncoder(dicomEncoderSettings)
                    ' save images to the destination DICOM file using DICOM encoder
                    images.SaveSync(destFilePath, encoder)
                End Using
            Finally
                ' remove images
                images.ClearAndDisposeItems()
            End Try
        End Using
    End Sub
    
    
    
    /// <summary>
    /// Loads DICOM images from DICOM file, burns the overlay images on DICOM images and saves changed DICOM images to a new DICOM file with compression.
    /// </summary>
    /// <param name="sourceFilePath">A path to a source DICOM file.</param>
    /// <param name="destFilePath">A path to the destination DICOM file.</param>
    public static void BurnOverlayImagesAndSaveToDicomFile(string sourceFilePath, string destFilePath)
    {
        // create image collection
        using (Vintasoft.Imaging.ImageCollection images = new Vintasoft.Imaging.ImageCollection())
        {
            // open DICOM file
            images.Add(sourceFilePath);
    
            try
            {
                // create DICOM decoding settings
                Vintasoft.Imaging.Codecs.Decoders.DicomDecodingSettings decodingSettings = new Vintasoft.Imaging.Codecs.Decoders.DicomDecodingSettings();
                // specify that DICOM decoder needs to draw overlay images on DICOM image
                decodingSettings.ShowOverlayImages = true;
                // set the DICOM decoding settings for all images in image collection
                images.SetDecodingSettings(decodingSettings);
    
                // for each image in image collection
                foreach (Vintasoft.Imaging.VintasoftImage image in images)
                {
                    // convert image to BGR24-image
                    image.ConvertToBgr24();
                }
    
                // create DICOM encoder settings with RLE compression
                Vintasoft.Imaging.Codecs.Encoders.DicomEncoderSettings dicomEncoderSettings =
                    new Vintasoft.Imaging.Codecs.Encoders.DicomEncoderSettings(
                        Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomImageCompressionType.RLE);
    
                // create DICOM encoder with compression settings
                using (Vintasoft.Imaging.Codecs.Encoders.DicomEncoder encoder = new Vintasoft.Imaging.Codecs.Encoders.DicomEncoder(dicomEncoderSettings))
                {
                    // save images to the destination DICOM file using DICOM encoder
                    images.SaveSync(destFilePath, encoder);
                }
            }
            finally
            {
                // remove images
                images.ClearAndDisposeItems();
            }
        }
    }
    
    

    Иерархия наследования

    System.Object
       Vintasoft.Imaging.Codecs.Encoders.EncoderSettings
          Vintasoft.Imaging.Codecs.Encoders.DicomEncoderSettings

    Требования

    Целевые платформы: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    Смотрите также