DeCaMino
ABOUT DOCUMENTATION DOWNLOAD LICENSING SUPPORT
DOCUMENTATION
As a plugin As a library
Get/Set attributes Storage SCP Direct write Storage SCU Storage commitment Query/Retrieve SCU Query/Retrieve SCP Worklist management File-sets (DICOMDIR) Direct encapsulation
DICOM conformance Image I/O conformance Changelog

Direct encapsulation

DICOM permits binary non-image documents like PDF and MPEG-2 or MPEG-4 video to be encapsulated in DICOM objects. Although the creation or decoding of such documents is out of the scope of DeCaMino, you can encapsulate or extract them.

Here is an example of creating and writing of a DICOM object including a video that is read from a file. The video must be encoded in an MPEG-TS or MPEG-4 container:

DicomWriter writer = new DicomWriter();

File out = new File("video.dcm");
writer.setOutput(out);

FileImageInputStream fiis = new FileImageInputStream("video.mp4");

DicomMetadata dmd = new DicomMetadata();
/* Set some data elements in dmd such as date, patient, etc... */
dmd.setPixelData(fiis, null, true);
writer.write(dmd);
DeCaMino will probe the MPEG-4 file video.mp4 and read the necessary information (size and length of the video) in order to fill out the required DICOM data elements to obtain a conform object. The transfer syntax can also be determined automatically from the video file.

More generally, pixel data can be set from a binary stream even in the non-video case. For example a JPEG-2000 codestream file can be directly encaspulated without requiring its decoding, thus saving computing resources.

Extracting the raw pixel data from an existing DICOM file is also possible:

DicomReader reader = new DicomReader();
reader.setInput(new File("image.dcm"));
DicomMetadata dmd = reader.getDicomMetadata();
ImageInputStream iis = dmd.getPixelData(0);
The resulting input stream can then be read and, for instance, dumped to a file.

PDF can be encapsulated in or extracted from a DICOM object with a similar mechanism, using input or output stream.

DICOM is the registered trademark of the National Electrical Manufacturers Association for its standards publications relating to digital communications of medical information.

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

apteryx is a registered trademark of apteryx, sarl.

DeCaMinoTM is a trademark of apteryx, sarl.

© apteryx 2024