فئة DicomOptions
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 | الوصف |
|---|---|
| DicomOptions() | يقوم بإنشاء نسخة جديدة من الفئة DicomOptions. |
Properties
| Name | Type | Access | الوصف |
|---|---|---|---|
| buffer_size_hint | int | r/w | يحصل أو يعيّن تلميح حجم المخزن المؤقت الذي يُعرف كأقصى حجم مسموح به لجميع المخازن الداخلية. |
| color_type | ColorType | r/w | يحصل أو يعيّن نوع اللون. |
| compression | Compression | r/w | يحصل أو يضبط الضغط. |
| تم التخلص | bool | r | يحصل على قيمة تشير إلى ما إذا كانت هذه المثيلة تم التخلص منها. |
| exif_data | ExifData | r/w | يحصل أو يعيّن بيانات Exif. |
| full_frame | bool | r/w | يحصل أو يعيّن قيمة تشير إلى ما إذا كان [full frame]. |
| keep_metadata | bool | r/w | يحصل على قيمة ما إذا كان يجب الاحتفاظ ببيانات التعريف الأصلية للصورة عند التصدير. |
| multi_page_options | MultiPageOptions | r/w | خيارات الصفحات المتعددة |
| palette | IColorPalette | r/w | يحصل أو يضبط لوحة الألوان. |
| resolution_settings | ResolutionSetting | r/w | يحصل أو يضبط إعدادات الدقة. |
| source | Source | r/w | يحصل أو يضبط المصدر لإنشاء الصورة فيه. |
| vector_rasterization_options | VectorRasterizationOptions | r/w | يحصل أو يضبط خيارات تحويل المتجه إلى نقطية. |
| xmp_data | XmpPacketWrapper | r/w | يحصل أو يضبط حاوية بيانات التعريف XMP. |
Methods
| Name | الوصف |
|---|---|
| clone() | ينشئ نسخة متماثلة لهذا الكائن. |
| try_set_metadata(metadata) | يحاول ضبط مثال metadata، إذا كان مثال هذا Image يدعم ويطبق مثال IImageMetadataFormat . |
Constructor: DicomOptions()
DicomOptions()
يقوم بإنشاء نسخة جديدة من الفئة DicomOptions.
Property: color_type
يحصل أو يعيّن نوع اللون.
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
يحصل أو يضبط الضغط.
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()
ينشئ نسخة متماثلة لهذا الكائن.
Returns
| نوع | الوصف |
|---|---|
| ImageOptionsBase | نسخة متماثلة لهذا الكائن. |
Method: try_set_metadata(metadata)
try_set_metadata(metadata)
يحاول ضبط مثال metadata، إذا كان مثال هذا Image يدعم ويطبق مثال IImageMetadataFormat .
Parameters:
| معامل | نوع | الوصف |
|---|---|---|
| metadata | IImageMetadataFormat | البيانات الوصفية. |
Returns
| نوع | الوصف |
|---|---|
| bool | صحيح، إذا كان كائن IMetadataContainer يدعم و/أو ينفّذ كائن IImageMetadataFormat; وإلا، خطأ. |
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"
# عينة الشيفرة التالية تحول صورة JPEG إلى تنسيق ملف DICOM
with Image.load(inputFileNameSingle) as image:
image.save(outputFileNameSingleDcm, DicomOptions())
# يدعم تنسيق DICOM الصور متعددة الصفحات. يمكنك تحويل صور GIF أو TIFF إلى DICOM بنفس طريقة صور JPEG.
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)