public class DicomOptions extends ImageOptionsBase
The DICOM file format creation options.
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.
|
XmpPacketWrapper |
getXmpData()
Gets the Xmp data.
|
void |
setColorType(int value)
Sets the type of the color.
|
void |
setCompression(Compression value)
Sets the compression.
|
void |
setXmpData(XmpPacketWrapper value)
Sets the Xmp data.
|
deepClone, getBufferSizeHint, getFullFrame, getMultiPageOptions, getPalette, getProgressEventHandler, getResolutionSettings, getSource, getVectorRasterizationOptions, setBufferSizeHint, setFullFrame, setMultiPageOptions, setPalette, setProgressEventHandler, setResolutionSettings, setSource, setVectorRasterizationOptions
close, dispose, getDisposed
public 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); }
public XmpPacketWrapper getXmpData()
Gets the Xmp data.
getXmpData
in class ImageOptionsBase
public void setXmpData(XmpPacketWrapper value)
Sets the Xmp data.
setXmpData
in class ImageOptionsBase
value
- the Xmp data.