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 write

In the previous example, we received a DICOM object from the network. Imagine you'd like to write it back to the file system after just checking some data elements. If you use the normal Image I/O procedure to write the object, you'll decode the image into a BufferedImage, then re-encode it with the write method of the DICOM writer. This is fine if you need to change the encoding process (the DICOM transfer syntax), but is a waste of time and memory if you do not. Moreover, the decoding-recoding procedure could produce some small discrepancy between the input and output images due to rounding errors.

To address this issue, DicomWriter provides a write(DicomMetadata dmd) method that will perform a direct write of the DICOM object without touching the encoding of pixel data. This method could also be used to write DICOM objects that does not contain images, such as worklist, reports, etc.

Here is the Storage SCP example updated to write the received object to a file named after the object SOP instance number:

DicomReader reader = new DicomReader();
DicomWriter writer = new DicomWriter();

StorageSCP scp = new StorageSCP();

reader.setInput(scp);
DicomMetadata dmd = reader.getDicomMetadata();

File out = new File(dmd.getSOPInstance());
writer.setOutput(out);
writer.write(dmd);

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