DicomOptions Class
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: IHasXmpData, IHasMetadata, ImageOptionsBase
Constructors
Name | Description |
---|---|
DicomOptions() | Initializes a new instance of the DicomOptions class. |
Properties
Name | Type | Access | Description |
---|---|---|---|
buffer_size_hint | int | r/w | Gets or sets the buffer size hint which is defined max allowed size for all internal buffers. |
color_type | ColorType | r/w | Gets or sets the type of the color. |
compression | Compression | r/w | Gets or sets the compression. |
disposed | bool | r | Gets a value indicating whether this instance is disposed. |
full_frame | bool | r/w | Gets or sets a value indicating whether [full frame]. |
keep_metadata | bool | r/w | Gets a value whether to keep original image metadata on export. |
multi_page_options | MultiPageOptions | r/w | The multipage options |
palette | IColorPalette | r/w | Gets or sets the color palette. |
resolution_settings | ResolutionSetting | r/w | Gets or sets the resolution settings. |
source | Source | r/w | Gets or sets the source to create image in. |
vector_rasterization_options | VectorRasterizationOptions | r/w | Gets or sets the vector rasterization options. |
xmp_data | XmpPacketWrapper | r/w | Gets or sets the XMP metadata container. |
Methods
Name | Description |
---|---|
clone() | Creates a memberwise clone of this instance. |
Constructor: DicomOptions()
DicomOptions()
Initializes a new instance of the DicomOptions class.
Property: color_type
Gets or sets the type of the color.
See also:
Example # 1: Use RLE compression in DICOM image.
Example # 2: Change the color type in DICOM compression.
Property: compression
Gets or sets the compression.
See also:
Example # 1: Use RLE compression in DICOM image.
Example # 2: Change the color type in DICOM compression.
Method: clone()
clone()
Creates a memberwise clone of this instance.
Returns
Type | Description |
---|---|
ImageOptionsBase | A memberwise clone of this instance. |
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"
# The next code sample converts JPEG image to DICOM file format
with Image.load(inputFileNameSingle) as image:
image.save(outputFileNameSingleDcm, DicomOptions())
# DICOM format supports multipage images. You can convert GIF or TIFF images to DICOM in the same way as JPEG images
with Image.load(inputFileNameMultipage) as image_multiple:
image_multiple.save(outputFileNameMultipageDcm, DicomOptions())
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)