How to get a "complete" DicomInputStream in the C-STORE response handler

130 views
Skip to first unread message

Tamás Sipos

unread,
Jul 13, 2018, 12:05:07 PM7/13/18
to dcm4che
I'm using BasicCStoreSCP to handle DCM4CHEE's C-STORE requests in my Java application.
It has two methods named onDimseRQ.

My question is whether I could use one of them to somehow create a DicomInputStream "of full value" from the received DICOM object - so that it would be the same as if I created it from a DICOM file.

To illustrate what I mean:

If I instantiate a DicomInputStream from the received PDVInputStream for example, then the method getFileMetaInformation() won't work on it.
getFileMetaInformation() would work however for DicomInputStreams created from DICOM files.

p.p...@synedra.com

unread,
Jul 15, 2018, 1:14:23 PM7/15/18
to dcm...@googlegroups.com
The Dicom File Meta Information, as the name says, is meta information that gets attached to files. If yout get your Dicom data over the network, you can retrieve that information from the provided commandset and presentation context. In fact, if you want to write the received Dicom data to the file system, you need to create the File Meta Information, with that data.

Here is how this would look with dcm4che:
 String classUid = commandSet.getString(Tag.AffectedSOPClassUID);
 
String instanceUid = commandSet.getString(Tag.AffectedSOPInstanceUID);
 
String transferSyntaxUid = presentationContext.getTransferSyntax();

 
Attributes fileMetaInformation = Attributes.createFileMetaInformation(classUid, instanceUid, transferSyntaxUid);
 fileMetaInformation
.setString(Tag.ImplementationClassUID, VR.UI, YOUR_IMPLEMENTATION_CLASS_UID);
 fileMetaInformation
.setString(Tag.ImplementationVersionName, VR.SH, YOUR_IMPLEMENTATION_VERSION_NAME);
 fileMetaInformation
.setString(Tag.SourceApplicationEntityTitle, VR.AE, association.getRemoteAET());

HTH ;),
Patrick

Tamás Sipos

unread,
Jul 17, 2018, 11:05:20 AM7/17/18
to dcm4che
Thank you for the explanation and code sample, it worked!
Reply all
Reply to author
Forward
0 new messages