public class DicomOptions extends ImageOptionsBase
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.
The following example shows export to DICOM file format (single and multipage).
String fileName = "sample.jpg";
String inputFileNameSingle = fileName;
String inputFileNameMultipage = "multipage.tif";
String outputFileNameSingleDcm = "output.dcm";
String outputFileNameMultipageDcm = "outputMultipage.dcm";
// The next code sample converts JPEG image to DICOM file format
try(com.aspose.imaging.Image image = com.aspose.imaging.Image.load(inputFileNameSingle))
{
image.save(outputFileNameSingleDcm, new com.aspose.imaging.imageoptions.DicomOptions());
}
// DICOM format supports multipage images. You can convert GIF or TIFF images to DICOM in the same way as JPEG images
try(com.aspose.imaging.Image imageMultiple = com.aspose.imaging.Image.load(inputFileNameMultipage))
{
imageMultiple.save(outputFileNameMultipageDcm, new com.aspose.imaging.imageoptions.DicomOptions());
}
| Constructor and Description |
|---|
DicomOptions()
Initializes a new instance of the
DicomOptions class. |
DicomOptions(DicomOptions options) |
| Modifier and Type | Method and Description |
|---|---|
int |
getColorType()
Gets the type of the color.
|
Compression |
getCompression()
Gets the compression.
|
void |
setColorType(int value)
Sets the type of the color.
|
void |
setCompression(Compression value)
Sets the compression.
|
deepClone, getBufferSizeHint, getFullFrame, getMultiPageOptions, getPalette, getProgressEventHandler, getResolutionSettings, getSource, getVectorRasterizationOptions, getXmpData, isKeepMetadata, setBufferSizeHint, setFullFrame, setKeepMetadata, setMultiPageOptions, setPalette, setProgressEventHandler, setResolutionSettings, setSource, setVectorRasterizationOptions, setXmpDataclose, dispose, getDisposedpublic DicomOptions()
Initializes a new instance of the DicomOptions class.
public DicomOptions(DicomOptions options)
public final Compression getCompression()
Gets the compression.
Value: The compression.public final void setCompression(Compression value)
Sets the compression.
Value: The compression.value - the compression.public final int getColorType()
Gets the type of the color.
Value: The type of the color.public final void setColorType(int value)
Sets the type of the color.
Value: The type of the color.value - the type of the color.Use JPEG compression in DICOM image.
try (Image inputImage = Image.load("original.jpg"))
{
DicomOptions options = new DicomOptions();
options.setColorType(ColorType.Rgb24Bit);
Compression compression = new Compression();
compression.setType(CompressionType.Jpeg);
JpegOptions jpegOptions = new JpegOptions();
jpegOptions.setCompressionType(JpegCompressionMode.Baseline);
jpegOptions.setSampleRoundingMode(SampleRoundingMode.Truncate);
jpegOptions.setQuality(50);
compression.setJpeg(jpegOptions);
options.setCompression(compression);
inputImage.save("original_JPEG.dcm", options);
}
Copyright (c) 2008-2025 Aspose Pty Ltd. All Rights Reserved.