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
| Name | Açıklama |
|---|---|
| DicomOptions() | Yeni bir DicomOptions sınıfı örneği başlatır. |
Properties
| Name | Type | Access | Açıklama |
|---|---|---|---|
| buffer_size_hint | int | r/w | Tüm iç tamponlar için tanımlanan maksimum izin verilen boyutu belirten tampon boyutu ipucunu alır veya ayarlar. |
| color_type | ColorType | r/w | Renk tipini alır veya ayarlar. |
| compression | Compression | r/w | Sıkıştırmayı alır veya ayarlar. |
| dağıtıldı | bool | r | Bu örneğin dağıtılıp dağıtılmadığını gösteren bir değer alır. |
| exif_data | ExifData | r/w | Exif verilerini alır veya ayarlar. |
| full_frame | bool | r/w | Tam çerçeve [full frame] olup olmadığını gösteren bir değeri alır veya ayarlar. |
| keep_metadata | bool | r/w | Dışa aktarırken orijinal görüntü meta verilerini tutup tutmayacağını gösteren bir değeri alır. |
| multi_page_options | MultiPageOptions | r/w | Çok sayfalı seçenekler |
| palette | IColorPalette | r/w | Renk paletini alır veya ayarlar. |
| resolution_settings | ResolutionSetting | r/w | Çözünürlük ayarlarını alır veya ayarlar. |
| source | Source | r/w | Görüntünün oluşturulacağı kaynağı alır veya ayarlar. |
| vector_rasterization_options | VectorRasterizationOptions | r/w | Vektör rasterleştirme seçeneklerini alır veya ayarlar. |
| xmp_data | XmpPacketWrapper | r/w | XMP meta veri kapsayıcısını alır veya ayarlar. |
Methods
| Name | Açı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ür | Açıklama |
|---|---|
| ImageOptionsBase | Bu ö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:
| Parameter | Tür | Açıklama |
|---|---|---|
| metadata | IImageMetadataFormat | Meta veriler. |
Returns
| Tür | Açıklama |
|---|---|
| bool | Doğ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)