ImageGear for Java User Guide > Using ImageGear for Java > Using the com.accusoft.imagegear.formats.dicom Package > Loading and Saving DICOM Images |
Load DICOM images in the same way as you load images of other formats. Use DICOM format options to set specific features for image loading.
There are two ways to specify transfer syntax (compression) for DICOM image saving: SaveFormat parameter, and TransferSyntax DICOM format option. SaveFormat is an easy-to-use shortcut, while TransferSytnax option provides the full selection of transfer syntaxes for image saving.
ImGearSavingFormats | ImGearCompressions | Transfer Syntax |
DICOM | AUTO | Defined by SaveSyntax option |
DICOM_UNCOMP | NONE | ImplicitLittleEndian |
DICOM_RLE | RLE | RLE |
DICOM_JPEG | JPEG | JPEG Lossy |
DICOM_JPEG2K | JPEG2K | JPEG2K Lossy |
This is the default mode for saving DICOM images with JPEG compression in ImageGear. In this mode:
If the source image colorspace is different from RGB or grayscale, or the bit depth is greater, ImageGear automatically converts image rasters to one of the supported pixel formats on saving. See PixelFormat ConversionduringImageSaving for more details.
As part of JPEG Lossy compression process, ImageGear converts RGB rasters into YCbCr colorspace (or YCC in DICOM terminology) during saving. This conversion is fully encapsulated into the ImageGear JPEG codec; the application should not convert images to YCbCr before saving them to JPEG or DICOM JPEG. |
Use one of these ways to save an image as DICOM JPEG Baseline or Extended:
This mode provides compatibility with viewers that do not support JPEG Extended coding process (12-bit images). In this mode:
If the source image colorspace is different from RGB or grayscale, or the bit depth is greater, ImageGear automatically converts image rasters to one of the supported pixel formats on saving. See Pixel Format Conversion during Image Saving for more details.
As part of the JPEG Lossy compression process, ImageGear converts RGB rasters into YCbCr colorspace (or YCC in DICOM terminology) during saving. This conversion is fully encapsulated into the ImageGear JPEG codec; the application should not convert images to YCbCr before saving them to JPEG or DICOM JPEG. |
To save an image as DICOM JPEG Baseline, use ImGearSavingFormats.DICOM saving format, and set SaveSyntax to ImGearDICOMTransferSyntaxes.JPEG_BASELINE_PR_1.
In this mode:
JPEG Lossless compression does not involve internal conversion or RGB rasters into YCbCr colorspace (YCC in DICOM terminology). |
To save an image as DICOM JPEG Lossless, use ImGearSavingFormats.DICOM saving format, and set SaveSyntax to ImGearDICOMTransferSyntaxes.JPEG_LOSSLESS or ImGearDICOMTransferSyntaxes.JPEG_LOSSLESS_NONH_PR_14.
DICOM provides a mechanism for supporting the use of Run Length Encoding (RLE) Compression, which is a byte oriented lossless compression scheme.
If the source image color space is different from RGB or grayscale, or the bit depth is greater, ImageGear automatically converts image rasters to one of the supported pixel formats on saving. See Pixel Format Conversion during Image Saving for more details.
Use one of the following to save an image as DICOM RLE:
ImageGear for Java allows saving of non-DICOM images to DICOM format. A default Secondary Capture DataSet is created for such images.
The DICOM format is not designed for an easy insertion of pages. The following issues exist:
According to the above issues, DICOM format filter in ImageGear for Java has the following limitations:
If any of the limitations are encountered, ImageGear throws an exception.
To save a multipage image:
Alternatively, create an ImGearDocument object, loading all images as ImGearPage objects in the document, and save the ImGearDocument as DICOM using the SaveDocument method.