OHIF-33: Adding thumbnailRendering config
This commit is contained in:
1 parent
fe6a1a9884
commit
1798a87d3f
6 files changed
+54
-17
No files matched your search
+1
-1
@@ -24,7 +24,7 @@ Template.imageThumbnail.onCreated(() => {
|
||||
imageIndex = 0;
|
||||
}
|
||||
|
||||
return imageInstance.getImageId();
|
||||
return imageInstance.getImageId(imageIndex, true);
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -4,10 +4,11 @@ import { getWADORSImageId } from './getWADORSImageId';
|
||||
* Obtain an imageId for Cornerstone from an image instance
|
||||
*
|
||||
* @param instance
|
||||
* @param frame
|
||||
* #param thumbnail
|
||||
* @returns {string} The imageId to be used by Cornerstone
|
||||
*/
|
||||
export function getImageId(instance, frame) {
|
||||
|
||||
export function getImageId(instance, frame, thumbnail) {
|
||||
if (!instance) {
|
||||
return;
|
||||
}
|
||||
@@ -16,15 +17,17 @@ export function getImageId(instance, frame) {
|
||||
return instance.url;
|
||||
}
|
||||
|
||||
if (instance.wadouri) {
|
||||
const renderingAttr = thumbnail ? 'thumbnailRendering' : 'imageRendering';
|
||||
|
||||
if (instance[renderingAttr] === 'wadouri') {
|
||||
var imageId = 'dicomweb:' + instance.wadouri;
|
||||
|
||||
if (frame !== undefined) {
|
||||
imageId += '&frame=' + frame;
|
||||
}
|
||||
|
||||
return imageId;
|
||||
} else {
|
||||
// TODO= Check multiframe image support with WADO-RS
|
||||
return getWADORSImageId(instance, frame); // WADO-RS Retrieve Frame
|
||||
return getWADORSImageId(instance, frame, thumbnail); // WADO-RS Retrieve Frame
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ class ImageMetadataBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
formatWADOREImageUrl = function(wadorsuri, frame) {
|
||||
formatWADORSImageUrl = function(wadorsuri, frame) {
|
||||
// We need to sum 1 because WADO-RS frame number is 1-based
|
||||
frame = (frame || 0) + 1;
|
||||
|
||||
@@ -61,7 +61,7 @@ formatWADOREImageUrl = function(wadorsuri, frame) {
|
||||
* @returns {string} The imageId to be used by Cornerstone
|
||||
*/
|
||||
export function getWADORSImageId(instance, frame) {
|
||||
const uri = formatWADOREImageUrl(instance.wadorsuri, frame);
|
||||
const uri = formatWADORSImageUrl(instance.wadorsuri, frame);
|
||||
const imageId = `wadors:${uri}`;
|
||||
|
||||
const imageMetadata = new ImageMetadataBuilder()
|
||||
|
||||
Reference in new issue
Block a user