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

NameDescription
DicomOptions()Initializes a new instance of the DicomOptions class.

Properties

NameTypeAccessDescription
buffer_size_hintintr/wGets or sets the buffer size hint which is defined max allowed size for all internal buffers.
color_typeColorTyper/wGets or sets the type of the color.
compressionCompressionr/wGets or sets the compression.
disposedboolrGets a value indicating whether this instance is disposed.
full_frameboolr/wGets or sets a value indicating whether [full frame].
keep_metadataboolr/wGets a value whether to keep original image metadata on export.
multi_page_optionsMultiPageOptionsr/wThe multipage options
paletteIColorPaletter/wGets or sets the color palette.
resolution_settingsResolutionSettingr/wGets or sets the resolution settings.
sourceSourcer/wGets or sets the source to create image in.
vector_rasterization_optionsVectorRasterizationOptionsr/wGets or sets the vector rasterization options.
xmp_dataXmpPacketWrapperr/wGets or sets the XMP metadata container.

Methods

NameDescription
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

TypeDescription
ImageOptionsBaseA 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)