Implementing a Storage SCU
A Storage SCU sends DICOM object to a peer application (acting as Storage SCP) across the network. This can be achieved using DeCaMino by simply setting the output of the DICOM writer to an instance of PeerAE
, a class representing a peer application entity.
DicomReader reader = new DicomReader(); reader.setInput(new File("image.dcm")); DicomMetada dmd = reader.getDicomMetadata(); PeerAE peer = new PeerAE(InetAddress.getByName("server.hospital.com"), "ARCHIVE"); DicomWriter writer = new DicomWriter(); writer.setOutput(peer); writer.write(dmd);
In this example, the object stored in file image.dcm
is sent to a storage SCP located at IP address server.hospital.com and whose DICOM application entity title is ARCHIVE. Since no other parameter is passed to the PeerAE
constructor, the well-known DICOM port is used, the calling application entity title is the default one ("DECAMINO") and the exchange is not encrypted.
As an alternative for the two last lines of the example, object dmd
can be sent using an explicit instance of class StorageSCU
:
StorageSCU scu = new StorageSCU(peer); scu.store(dmd, writer);By default, DeCaMino proposes the transfer syntax
image.dcm
is encoded with to the peer application, as well as uncompressed transfer syntaxes. If the original transfer syntax is accepted by the peer application, the pixel data is sent as is, but if it is not, DeCaMino will automatically decode the pixel data and use uncompressed transmission. A finer control over the proposed transfer syntaxes is possible with the DicomWriter.setTransferSyntaxes
method.