I can C-STORE a DICOM file but not a DICOM object

52 views
Skip to first unread message

Tamás Sipos

unread,
Apr 18, 2018, 5:53:53 AM4/18/18
to dcm...@googlegroups.com
Reading a DICOM file from the file system and then sending it in a C-STORE request looks like this:

DicomInputStream dis = new DicomInputStream(path.toFile());

Attributes meta = dis.getFileMetaInformation();

InputStreamDataWriter dw = new InputStreamDataWriter(dis);

assoc
.cstore(meta.getString(0x00020002), meta.getString(0x00020003),
   
0x0000, dw, meta.getString(0x00020010), new DimseRSPHandler(assoc.nextMessageID()) { ...

That's okay, it works. However, prior to the C-STORE I have to change some tags in the DICOM file (reconciliation for PACS) so I convert it to a DICOM (Attributes) object to be able to do so, then perform the modifications:

Attributes dcmObj = dis.readItem(); // I guess that's the right method for this purpose

dcmObj = DICOMReconc.reconcile(dcmObj); // Just some custom implementation to change some tags

And now here I am with an Attributes object that I somehow should convert back into a DataWriter object so I can give it to cstore().

Any ideas how to do that?

Lutrero

unread,
Apr 18, 2018, 8:00:57 AM4/18/18
to dcm4che
Hello, you can do it this way


Attributes data = in.readDataset(-1,-1);
.
.
.
association.cstore(cuid, iuid, priority, new DataWriterAdapter(data), ts, rspHandlerFactory.createDimseRSPHandler(f));

Tamás Sipos

unread,
Apr 18, 2018, 8:55:49 AM4/18/18
to dcm4che
It works, thank you!
Reply all
Reply to author
Forward
0 new messages