ohif-viewer/Packages/ohif-viewerbase/client/lib/getImageId.js
Evren Ozkan 76ebe11c8e OHIF-149 The viewer shall allow the root URL to be changed - WIP
- Use absoluteUrl for hard-coded paths in html and js
2017-01-10 13:09:43 -05:00

29 lines
713 B
JavaScript

import { Meteor } from "meteor/meteor";
/**
* Obtain an imageId for Cornerstone from an image instance
*
* @param instance
* @returns {string} The imageId to be used by Cornerstone
*/
getImageId = function(instance, frame) {
if (!instance) {
return;
}
if (instance.url) {
return instance.url;
}
if (instance.wadouri) {
var imageId = 'dicomweb:' + Meteor.absoluteUrl(instance.wadouri); // WADO-URI;
if (frame !== undefined) {
imageId += '&frame=' + frame;
}
return imageId;
} else {
// TODO= Check multiframe image support with WADO-RS
return getWADORSImageId(instance); // WADO-RS Retrieve Frame
}
};