DicomOptions Sınıfı

Summary: The API for Digital Imaging and Communications in Medicine (DICOM) raster image
format creation is a specialized tool tailored for medical device applications.
It enables the seamless generation of DICOM images, crucial for storing medical
data and containing vital identification information. With features to
and set compression, define color types, and embed XMP metadata, developers
can ensure compliance and flexibility in managing DICOM images for medical
imaging purposes.

Module: aspose.imaging.imageoptions

Full Name: aspose.imaging.imageoptions.DicomOptions

Inheritance: IMetadataContainer, IHasExifData, IHasMetadata, IHasXmpData, ImageOptionsBase

Constructors

NameAçıklama
DicomOptions()Yeni bir DicomOptions sınıfı örneği başlatır.

Properties

NameTypeAccessAçıklama
buffer_size_hintintr/wTüm iç tamponlar için tanımlanan maksimum izin verilen boyutu belirten tampon boyutu ipucunu alır veya ayarlar.
color_typeColorTyper/wRenk tipini alır veya ayarlar.
compressionCompressionr/wSıkıştırmayı alır veya ayarlar.
dağıtıldıboolrBu örneğin dağıtılıp dağıtılmadığını gösteren bir değer alır.
exif_dataExifDatar/wExif verilerini alır veya ayarlar.
full_frameboolr/wTam çerçeve [full frame] olup olmadığını gösteren bir değeri alır veya ayarlar.
keep_metadataboolr/wDışa aktarırken orijinal görüntü meta verilerini tutup tutmayacağını gösteren bir değeri alır.
multi_page_optionsMultiPageOptionsr/wÇok sayfalı seçenekler
paletteIColorPaletter/wRenk paletini alır veya ayarlar.
resolution_settingsResolutionSettingr/wÇözünürlük ayarlarını alır veya ayarlar.
sourceSourcer/wGörüntünün oluşturulacağı kaynağı alır veya ayarlar.
vector_rasterization_optionsVectorRasterizationOptionsr/wVektör rasterleştirme seçeneklerini alır veya ayarlar.
xmp_dataXmpPacketWrapperr/wXMP meta veri kapsayıcısını alır veya ayarlar.

Methods

NameAçıklama
clone()Bu örneğin üye bazlı bir klonunu oluşturur.
try_set_metadata(metadata)Bu Image örneği destekliyor ve IImageMetadataFormat örneğini uyguluyorsa, bir metadata örneği ayarlamaya çalışır.

Constructor: DicomOptions()

 DicomOptions() 

Yeni bir DicomOptions sınıfı örneği başlatır.

Property: color_type

Renk tipini alır veya ayarlar.

See also:

Example # 1: Use JPEG compression in DICOM image.

Example # 2: Use JPEG 2000 compression in DICOM image.

Example # 3: Use RLE compression in DICOM image.

Example # 4: Change the color type in DICOM compression.

Property: compression

Sıkıştırmayı alır veya ayarlar.

See also:

Example # 1: Use JPEG compression in DICOM image.

Example # 2: Use JPEG 2000 compression in DICOM image.

Example # 3: Use RLE compression in DICOM image.

Example # 4: Change the color type in DICOM compression.

Method: clone()

 clone() 

Bu örneğin üye bazlı bir klonunu oluşturur.

Returns

TürAçıklama
ImageOptionsBaseBu örneğin üye bazlı bir klonu.

Method: try_set_metadata(metadata)

 try_set_metadata(metadata) 

Bu Image örneği destekliyor ve IImageMetadataFormat örneğini uyguluyorsa, bir metadata örneği ayarlamaya çalışır.

Parameters:

ParameterTürAçıklama
metadataIImageMetadataFormatMeta veriler.

Returns

TürAçıklama
boolDoğru, eğer IMetadataContainer örneği IImageMetadataFormat örneğini destekliyor ve/veya uyguluyorsa; aksi takdirde, yanlış.

Examples

The following example shows export to DICOM file format (single and multipage).


from aspose.imaging import Image
from aspose.imaging.imageoptions import DicomOptions

fileName = "sample.jpg"
inputFileNameSingle = fileName
inputFileNameMultipage = "multipage.tif"
outputFileNameSingleDcm = "output.dcm"
outputFileNameMultipageDcm = "outputMultipage.dcm"

# Aşağıdaki kod örneği JPEG görüntüsünü DICOM dosya formatına dönüştürür.
with Image.load(inputFileNameSingle) as image:
	image.save(outputFileNameSingleDcm, DicomOptions())

# DICOM formatı çok sayfalı görüntüleri destekler. GIF veya TIFF görüntülerini JPEG görüntüleri gibi aynı şekilde DICOM'a dönüştürebilirsiniz.
with Image.load(inputFileNameMultipage) as image_multiple:
	image_multiple.save(outputFileNameMultipageDcm, DicomOptions())

Use JPEG compression in DICOM image.

import aspose.pycore as aspycore
from aspose.imaging import Image
from aspose.imaging.imageoptions import JpegOptions, DicomOptions
from aspose.imaging.fileformats.jpeg import JpegCompressionMode, SampleRoundingMode
from aspose.imaging.imageoptions import DicomOptions
from aspose.imaging.fileformats.dicom import Compression, ColorType, CompressionType

with Image.load("original.jpg") as input_image:
	obj_init = JpegOptions()
	obj_init.compression_type = JpegCompressionMode.BASELINE
	obj_init.sample_rounding_mode = SampleRoundingMode.TRUNCATE
	obj_init.quality = 50
	obj_init2 = Compression()
	obj_init2.type = CompressionType.JPEG
	obj_init2.jpeg = obj_init
	options = DicomOptions()
	options.color_type = ColorType.RGB_24_BIT
	options.compression = obj_init2
	input_image.save("original_JPEG.dcm", options)

Use JPEG 2000 compression in DICOM image.

import aspose.pycore as aspycore
from aspose.imaging import Image
from aspose.imaging.imageoptions import Jpeg2000Options, DicomOptions
from aspose.imaging.fileformats.jpeg2000 import Jpeg2000Codec, Compression, CompressionType, ColorType

with Image.load("original.jpg") as input_image:
	obj_init = Jpeg2000Options()
	obj_init.codec = Jpeg2000Codec.JP2
	obj_init.irreversible = False
	obj_init2 = Compression()
	obj_init2.type_ = CompressionType.JPEG2000
	obj_init2.jpeg2000 = obj_init
	options = DicomOptions()
	options.color_type = ColorType.RGB_24_BIT
	options.compression = obj_init2
	input_image.save("original_JPEG2000.dcm", options)

Use RLE compression in DICOM image.


from aspose.imaging import Image
from aspose.imaging.fileformats.dicom import Compression, CompressionType, ColorType
from aspose.imaging.imageoptions import DicomOptions

with Image.load("original.jpg") as input_image:
	compr = Compression()
	compr.type_ = CompressionType.RLE
	options = DicomOptions()
	options.color_type = ColorType.RGB_24_BIT
	options.compression = compr
	input_image.save("original_RLE.dcm", options)

Change the color type in DICOM compression.


from aspose.imaging import Image
from aspose.imaging.imageoptions import DicomOptions
from aspose.imaging.fileformats.dicom import ColorType

with Image.load("original.jpg") as inputImage:
	options = DicomOptions()
	options.color_type = ColorType.GRAYSCALE_8_BIT
	inputImage.save("original_8Bit.dcm", options)