OHIF-25: Multi-frame images should be loaded one frame at a time
This commit is contained in:
parent
6cb0050f38
commit
b31d7441ea
@ -227,11 +227,9 @@ function resultDataToStudyMetadata(server, studyInstanceUid, resultData) {
|
|||||||
if (server.imageRendering === 'wadouri') {
|
if (server.imageRendering === 'wadouri') {
|
||||||
instanceSummary.wadouri = WADOProxy.convertURL(server.wadoUriRoot + '?requestType=WADO&studyUID=' + studyInstanceUid + '&seriesUID=' + seriesInstanceUid + '&objectUID=' + sopInstanceUid + '&contentType=application%2Fdicom', server.requestOptions);
|
instanceSummary.wadouri = WADOProxy.convertURL(server.wadoUriRoot + '?requestType=WADO&studyUID=' + studyInstanceUid + '&seriesUID=' + seriesInstanceUid + '&objectUID=' + sopInstanceUid + '&contentType=application%2Fdicom', server.requestOptions);
|
||||||
} else {
|
} else {
|
||||||
instanceSummary.wadorsuri = server.wadoRoot + '/studies/' + studyInstanceUid + '/series/' + seriesInstanceUid + '/instances/' + sopInstanceUid + '/frames/1';
|
instanceSummary.wadorsuri = WADOProxy.convertURL(server.wadoRoot + '/studies/' + studyInstanceUid + '/series/' + seriesInstanceUid + '/instances/' + sopInstanceUid + '/frames/1');
|
||||||
}
|
}
|
||||||
|
|
||||||
instanceSummary.wadorsuri = WADOProxy.convertURL(server.wadoRoot + '/studies/' + studyInstanceUid + '/series/' + seriesInstanceUid + '/instances/' + sopInstanceUid + '/frames/1');
|
|
||||||
|
|
||||||
series.instances.push(instanceSummary);
|
series.instances.push(instanceSummary);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -13,9 +13,16 @@ Template.imageThumbnail.onCreated(() => {
|
|||||||
// Get the image ID for current thumbnail
|
// Get the image ID for current thumbnail
|
||||||
instance.getThumbnailImageId = () => {
|
instance.getThumbnailImageId = () => {
|
||||||
const stack = instance.data.thumbnail.stack;
|
const stack = instance.data.thumbnail.stack;
|
||||||
const lastIndex = (stack.images.length || 1) - 1;
|
const lastIndex = (stack.numImageFrames || stack.images.length || 1) - 1;
|
||||||
const imageIndex = Math.floor(lastIndex / 2) !== 0 ? 0 : 0;
|
let imageIndex = Math.floor(lastIndex / 2);
|
||||||
const imageInstance = stack.images[imageIndex];
|
let imageInstance;
|
||||||
|
|
||||||
|
if(stack.isMultiFrame) {
|
||||||
|
imageInstance = stack.images[0];
|
||||||
|
} else {
|
||||||
|
imageInstance = stack.images[imageIndex];
|
||||||
|
imageIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
return imageInstance.getImageId();
|
return imageInstance.getImageId();
|
||||||
};
|
};
|
||||||
|
|||||||
@ -105,7 +105,8 @@ const loadDisplaySetIntoViewport = (data, templateData) => {
|
|||||||
|
|
||||||
// Enable Cornerstone for the viewport element
|
// Enable Cornerstone for the viewport element
|
||||||
const options = {
|
const options = {
|
||||||
renderer: 'webgl'
|
// TODO: It's not working with WADO-RS requests (see getWADORSImageId)
|
||||||
|
// renderer: 'webgl'
|
||||||
};
|
};
|
||||||
|
|
||||||
// NOTE: This uses the experimental WebGL renderer for Cornerstone!
|
// NOTE: This uses the experimental WebGL renderer for Cornerstone!
|
||||||
|
|||||||
@ -25,6 +25,6 @@ export function getImageId(instance, frame) {
|
|||||||
return imageId;
|
return imageId;
|
||||||
} else {
|
} else {
|
||||||
// TODO= Check multiframe image support with WADO-RS
|
// TODO= Check multiframe image support with WADO-RS
|
||||||
return getWADORSImageId(instance); // WADO-RS Retrieve Frame
|
return getWADORSImageId(instance, frame); // WADO-RS Retrieve Frame
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,14 +42,26 @@ class ImageMetadataBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
formatWADOREImageUrl = function(wadorsuri, frame) {
|
||||||
|
// We need to sum 1 because WADO-RS frame number is 1-based
|
||||||
|
frame = (frame || 0) + 1;
|
||||||
|
|
||||||
|
// Replaces /frame/1 by /frame/{frame}
|
||||||
|
// TODO: Maybe should be better to export the WADOProxy to be able to use it on client
|
||||||
|
// Example: WADOProxy.convertURL(baseWadoRsUri + '/frame/' + frame)
|
||||||
|
wadorsuri = wadorsuri.replace(/(%2Fframes%2F)(\d+)/, `$1${frame}`);
|
||||||
|
|
||||||
|
return Meteor.absoluteUrl(wadorsuri);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain an imageId for Cornerstone based on the WADO-RS scheme
|
* Obtain an imageId for Cornerstone based on the WADO-RS scheme
|
||||||
*
|
*
|
||||||
* @param {object} instanceMetada metadata object (InstanceMetadata)
|
* @param {object} instanceMetada metadata object (InstanceMetadata)
|
||||||
* @returns {string} The imageId to be used by Cornerstone
|
* @returns {string} The imageId to be used by Cornerstone
|
||||||
*/
|
*/
|
||||||
export function getWADORSImageId(instance) {
|
export function getWADORSImageId(instance, frame) {
|
||||||
const uri = Meteor.absoluteUrl(instance.wadorsuri);
|
const uri = formatWADOREImageUrl(instance.wadorsuri, frame);
|
||||||
const imageId = `wadors:${uri}`;
|
const imageId = `wadors:${uri}`;
|
||||||
|
|
||||||
const imageMetadata = new ImageMetadataBuilder()
|
const imageMetadata = new ImageMetadataBuilder()
|
||||||
|
|||||||
52
config/dcm4cheeDICOMWeb.json
Normal file
52
config/dcm4cheeDICOMWeb.json
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
{
|
||||||
|
"servers": {
|
||||||
|
"dicomWeb": [
|
||||||
|
{
|
||||||
|
"name": "DCM4CHEE",
|
||||||
|
"wadoUriRoot": "http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/wado",
|
||||||
|
"qidoRoot": "http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/rs",
|
||||||
|
"wadoRoot": "http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/rs",
|
||||||
|
"qidoSupportsIncludeField": false,
|
||||||
|
"imageRendering": "wadors",
|
||||||
|
"requestOptions": {
|
||||||
|
"auth": "admin:admin",
|
||||||
|
"logRequests": true,
|
||||||
|
"logResponses": false,
|
||||||
|
"logTiming": true
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
"dimse": [{
|
||||||
|
"name": "DCM4CHEE_DIMSE",
|
||||||
|
"wadoUriRoot": "http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/wado",
|
||||||
|
"requestOptions": {
|
||||||
|
"auth": "admin:admin",
|
||||||
|
"logRequests": true,
|
||||||
|
"logResponses": false,
|
||||||
|
"logTiming": true
|
||||||
|
},
|
||||||
|
"peers": [
|
||||||
|
{
|
||||||
|
"host": "localhost",
|
||||||
|
"port": 4242,
|
||||||
|
"aeTitle": "DCM4CHEE",
|
||||||
|
"default": true,
|
||||||
|
"supportsInstanceRetrievalByStudyUid": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"host": "0.0.0.0",
|
||||||
|
"port": 11112,
|
||||||
|
"aeTitle": "DCM4CHEE",
|
||||||
|
"default": true,
|
||||||
|
"server": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
"defaultServiceType": "dicomWeb",
|
||||||
|
"public": {
|
||||||
|
"verifyEmail": false,
|
||||||
|
"ui": {
|
||||||
|
"studyListFunctionsEnabled": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user