As a plugin
Dimple is composed of a jar file and a native library file. When these files are copied to the class path and library path of an Image I/O aware application, the DICOM format is immediately available for reading and writing.
When reading, for instance with
BufferedImage image = ImageIO.read(new File("image.dcm"));the plugin returns an image or a series of images with all DICOM gray-scale transforms applied, so that the image or series is immedialetly suitable for rendering on a display.
When writing an image or a series of images that was not encoded as a DICOM object in the first place, such as in:
BufferedImage image = ImageIO.read(new File("image.png")); ImageIO.write(image, "dicom", new File("image.dcm"));a conform DICOM object is created using one of the Multiframe Secondary Capture SOP class. This means that up to 16-bit grayscale images and 8-bit color images may be written. By default, the pixel data is written uncompressed, but the compression scheme (DICOM transfer syntax) and level can be chosen using generic Image I/O parameters.