Skip to content

Store objects by STOW RS

Vrinda edited this page Mar 27, 2023 · 1 revision

Overview

One may use the RESTful service supported by the archive to store objects over the web. This can be done in one of the following ways :

Using Archive UI

  1. To upload bulkdata (pdf, image or video), this can be done on study level or on MWL level. One can find this option when clicked against the study/MWL on the 3 vertical dots. An upward arrow indicating Upload file lets one upload bulkdata to this study or MWl.

  2. To upload DICOM objects, go to More functions and select Upload DICOM objects to select any number of DICOM objects that needs to be uploaded.

Using dcm4che tool

Simply use the stowrs tool from dcm4che library. See below examples.

  1. Send stow request to stowRS Receiver with the attribute given and img.jpeg bulkData.
stowrs -m PatientName=John^Doe -u http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/rs/studies img.jpeg
  1. Send stow request to stowRS Receiver with the attribute given and img.jpeg bulkData.
stowrs -t json --xc -m PatientID=P1 -u http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/rs/studies img1.jpeg img2.jpg img3.jpeg
  1. Send stow request to stowRS Receiver with the given dicom file.
stowrs -u http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/rs/studies
object1.dcm object2.dcm

Note :

  • Multiple DICOM files can be sent at a time in one request to the archive.
  • With -t option specified as json, multiple bulkdata files (of same file type, i.e. for eg. only images or only pdfs or only videos) can be sent at a time in one request to the archive.
  • Supported bulkdata extensions are pdf, jpg, jpeg, mpg, mpg2 and mpeg.

See stowrs --help for more information.

Using curl

According DICOM Part 18, 10.5 Store Transaction wrap the DICOM Part 10 files into a MIME Multipart/Related message, before sending it by a HTTP POST request, e.g. on Linux:

echo -ne "\r\n--myboundary\r\nContent-Type: application/dicom\r\n\r\n" > mime.dicom.head
echo -ne "\r\n--myboundary--" > mime.tail
cat mime.dicom.head dicom-file1.dcm mime.dicom.head dicom-file2.dcm mime.tail > dicom.mime
curl -X POST -H "Content-Type: multipart/related; type=\"application/dicom\"; boundary=myboundary" \
     http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/rs/studies --data-binary @dicom.mime

For sending plain JPEG images you have to wrap them together with the metadata in JSON or XML format in a MIME Multipart/Related message, e.g.:

echo -ne "\r\n--myboundary\r\nContent-Type: application/dicom+json\r\n\r\n" > mime.metadata.head
echo -ne "\r\n--myboundary\r\nContent-Type: image/jpeg\r\nContent-Location: file1.jpg\r\n\r\n" > mime.jpeg1.head
echo -ne "\r\n--myboundary\r\nContent-Type: image/jpeg\r\nContent-Location: file2.jpg\r\n\r\n" > mime.jpeg2.head
echo -ne "\r\n--myboundary--" > mime.tail
cat mime.metadata.head metadata.json mime.jpeg1.head file1.jpg mime.jpeg2.head file2.jpg mime.tail > metadata+jpeg.mime
curl -X POST -H "Content-Type: multipart/related; type=\"application/dicom+json\"; boundary=myboundary" \
     http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/rs/studies --data-binary @metadata+jpeg.mime

with metadata.json:

[{
"00080016": { "vr": "UI", "Value": [ "1.2.840.10008.5.1.4.1.1.7" ] },
"00080018": { "vr": "UI", "Value": [ "2.25.120844308671949461864937780667935865261" ] },
"00080020": { "vr": "DA" },
"00080030": { "vr": "TM" },
"00080050": { "vr": "SH" },
"00080060": { "vr": "CS", "Value": [ "OT" ] },
"00080064": { "vr": "CS", "Value": [ "WSD" ] },
"00080070": { "vr": "LO" },
"00080090": { "vr": "PN" },
"00100010": { "vr": "PN", "Value": [{ "Alphabetic": "Patient^Name" }]},
"00100020": { "vr": "LO", "Value": [ "PatientID" ] },
"00100030": { "vr": "DA" },
"00100040": { "vr": "CS" },
"0020000D": { "vr": "UI", "Value": [ "2.25.325835831109079562541560856033484422761" ] },
"0020000E": { "vr": "UI", "Value": [ "2.25.152887376887097953030407776906882151652" ] },
"00200010": { "vr": "SH" },
"00200011": { "vr": "IS", "Value": [ 1 ] },
"00200013": { "vr": "IS", "Value": [ 1 ] },
"7FE00010": { "vr": "OB", "BulkDataURI": "file1.jpg" }
},{
"00080016": { "vr": "UI", "Value": [ "1.2.840.10008.5.1.4.1.1.7" ] },
"00080018": { "vr": "UI", "Value": [ "2.25.30207206599873576648053269184806854221" ] },
"00080020": { "vr": "DA" },
"00080030": { "vr": "TM" },
"00080050": { "vr": "SH" },
"00080060": { "vr": "CS", "Value": [ "OT" ] },
"00080064": { "vr": "CS", "Value": [ "WSD" ] },
"00080070": { "vr": "LO" },
"00080090": { "vr": "PN" },
"00100010": { "vr": "PN", "Value": [{ "Alphabetic": "Patient^Name" }]},
"00100020": { "vr": "LO", "Value": [ "PatientID" ] },
"00100030": { "vr": "DA" },
"00100040": { "vr": "CS" },
"0020000D": { "vr": "UI", "Value": [ "2.25.325835831109079562541560856033484422761" ] },
"0020000E": { "vr": "UI", "Value": [ "2.25.152887376887097953030407776906882151652" ] },
"00200010": { "vr": "SH" },
"00200011": { "vr": "IS", "Value": [ 1 ] },
"00200013": { "vr": "IS", "Value": [ 2 ] },
"7FE00010": { "vr": "OB", "BulkDataURI": "file2.jpg" }
}]
Clone this wiki locally