Is Orthanc Server QIDO-RS, WADO-RS and STOR-RS conformed?

Also, I noticed that several elements are incorrectly being returned as bulk data items in WADO-RS and QIDO-RS responses. Specifically Rows, Columns, Bits Allocated, High Bit and Retrieve URL.

Chris

Hi Chris,

I have pushed several changelists that should fix all the problems you have reported.

I would love to hear your feedback about these fixes: Do they solve your problems?

Regarding the WADO-RS “RetrieveFrames”, this is certainly on my roadmap for June. However, my priority is now to implement C-Move SCU and to subsequently release Orthanc 0.9.0.

Sébastien-

Hi Chris,

My ultimate goal is to not use WADO-URI and I can do this once you implement WADO-RS RetrieveFrames. Any idea on when that might be done?

WADO-RS RetrieveFrames is implemented in the version 0.2 of the DICOMweb plugin that has just been published:

http://www.orthanc-server.com/browse.php?path=/plugin-dicom-web

HTH,
Sébastien-

Awesome!! I’ll see if I can test it out in the coming weeks (I already added initial support for it to the OHIF Viewer and cornerstone but haven’t had a server implementation to test with yet!)

Great! Let me know if you face issues… because on my side, I’ve no viewer to test against, this is kind of chicken-and-egg problem :slight_smile:

Hi,

For some few days now i have struggled with the store of dicom files in orthanc using the dicom-web.

i have tried the example provided here https://bitbucket.org/sjodogne/orthanc-dicomweb/src/3ec1e035c84f7b13897c50da73653ebcf5d33f1a/Samples/JavaScript/stow-rs.js?at=default&fileviewer=file-view-default, it works fine. But when i implement the same on an angular app i get

`

{
“HttpError” : “Bad Request”,
“HttpStatus” : 400,
“Message” : “Bad file format”,
“Method” : “POST”,
“OrthancError” : “Bad file format”,
“OrthancStatus” : 15,
“Uri” : “/dicom-web/studies”
}

`

The same file uploads fine using the jQuery sample.

Seems like the encoding of the file after the Unit8Array is not right, how do i convert to the right format?

Hello,

I’m not an angular developer, so I can’t provide any support.

Furthermore, you should share source code for other people to be able to help you.

Regards,
Sébastien-

PS: Make sure to use the just-released 0.5 version of the DICOMweb plugin.

Below is a sample code in anguar, which returns a Bad file Format

`

private apiUrl = environment.pacs_servers[0].apiUrl;
BOUNDARY = ‘MESSAGEBOUNDARY’;

storeStudies(image): Promise { // the passed parameter is in bufferArray

return new Promise((resolve, reject) => {
// construct Multipart
let body = this.constructMultipart(image, ‘application/dicom’);

var convertedBody = this.convertUint8ArrayToBinaryString(body)

const headers = {
‘Accept’: ‘application/json’,
‘Content-Type’: ‘multipart/related; type=application/dicom; boundary=’ + this.BOUNDARY
};

// post to the api
this.http.post(this.apiUrl + ‘studies’, convertedBody, { headers: headers, responseType: ‘json’ }).subscribe((res) => {
console.log(‘saved’, res);
let count = res[‘00081199’].Value.length;
console.log(‘Upload was a success! ’ + count + ’ instance was uploaded.’);
resolve(res)
}), (err: HttpErrorResponse) => {
console.log(‘error with http post’, err)
reject(err)
};
});
}

convertUint8ArrayToBinaryString(u8Array) {
var i, len = u8Array.length, b_str = “”;
for (i=0; i<len; i++) {
b_str += String.fromCharCode(u8Array[i]);
}
return b_str;
}

stringToArrayBuffer(str) {
// http://updates.html5rocks.com/2012/06/How-to-convert-ArrayBuffer-to-and-from-String
let bufView = new Uint8Array(str.length);
for (let i = 0, strLen = str.length; i < strLen; i++) {
bufView[i] = str.charCodeAt(i);
}
return bufView;
}

constructMultipart(body, contentType) {
let headerStr = ‘–’ + this.BOUNDARY + '\r\nContent-Type: ’ + contentType + ‘\r\n\r\n’;
let trailerStr = ‘\r\n–’ + this.BOUNDARY + ‘–\r\n’;

let header = this.stringToArrayBuffer(headerStr);
let trailer = this.stringToArrayBuffer(trailerStr);

// Concatenate the header, the body and the trailer
// http://stackoverflow.com/a/14071518/881731
let b = new Uint8Array(header.byteLength + body.byteLength + trailer.byteLength);
b.set(header);
b.set(new Uint8Array(body), header.byteLength);
b.set(trailer, header.byteLength + body.byteLength);

// console.log(b);
// returns a Unit8Array
return b;
}

`

Figured out the problem

The function i used before to convert to convert to bufferArray didn’t return the right format, here is a code that works for me to convert from Unit8Array to BufferArray:

`

// convert unit8Array back to buffer
const convertedBody = body.buffer;

`

Hi,

I am trying to make stow-rs request to store an instance in orthnac. but i want to send json metadata not dicom file as it is. I could not find any solid example of framing json metadata with jpeg body. Please help me with some example of sending stow-rs with json metadata.

Thanks
Manasa

As can be read in the “Status.txt” file, the DICOMweb plugin currently does not support STOW-RS with JSON metadata:
https://bitbucket.org/sjodogne/orthanc-dicomweb/src/default/Status.txt