Fix bugs which prevents loading multi-frame instances with custom image loaders
- Construct image id based on frame (if defined) for custom image loaders as well - Use DICOMFileLoadingListener for multi-frame images and image loaders except wado
This commit is contained in:
parent
c5c5ddf282
commit
7519006e64
@ -373,7 +373,7 @@ class StudyLoadingListener {
|
|||||||
// how many frames has already been loaded (bytes/s instead of frames/s).
|
// how many frames has already been loaded (bytes/s instead of frames/s).
|
||||||
if ((schema === 'wadors') || !stackMetaData.isMultiFrame) {
|
if ((schema === 'wadors') || !stackMetaData.isMultiFrame) {
|
||||||
return new StackLoadingListener(stack);
|
return new StackLoadingListener(stack);
|
||||||
} else if ((schema === 'dicomweb') || (schema === 'wadouri')) {
|
} else {
|
||||||
return new DICOMFileLoadingListener(stack);
|
return new DICOMFileLoadingListener(stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,17 @@
|
|||||||
import { getWADORSImageId } from './getWADORSImageId';
|
import { getWADORSImageId } from './getWADORSImageId';
|
||||||
|
|
||||||
|
// https://stackoverflow.com/a/6021027/3895126
|
||||||
|
function updateQueryStringParameter(uri, key, value) {
|
||||||
|
var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
|
||||||
|
var separator = uri.indexOf('?') !== -1 ? "&" : "?";
|
||||||
|
if (uri.match(re)) {
|
||||||
|
return uri.replace(re, '$1' + key + "=" + value + '$2');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return uri + separator + key + "=" + value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain an imageId for Cornerstone from an image instance
|
* Obtain an imageId for Cornerstone from an image instance
|
||||||
*
|
*
|
||||||
@ -14,6 +26,10 @@ export function getImageId(instance, frame, thumbnail) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (instance.url) {
|
if (instance.url) {
|
||||||
|
if (frame !== undefined) {
|
||||||
|
instance.url = updateQueryStringParameter(instance.url, 'frame', frame);
|
||||||
|
}
|
||||||
|
|
||||||
return instance.url;
|
return instance.url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user