fix(DICOM PDF and Video): fixes for local DICOM load and remote data sources (#3374)

* fix(DICOM PDF and Video)
- added retrieve.directURL for local DICOM load data source; it returns a data URL
- fixed various checks for video using transfer syntaxes and SOP class UID with number of frames
- added call to 'rendered' endpoint for those data sources that support it; others get BulkDataURI

* Added DOC (PDF) and OT (for video in particular) to list of non-image thumbnail modalities.

* Fixed broken e2e tests.
This commit is contained in:
Joe Boccanfuso authored and GitHub committed 2023-05-10 12:42:48 -04:00
1 parent 0eda151418
commit 8eaa1877fd
12 files changed
+59 -20

No files matched your search

+10 -8
View File
@@ -19,13 +19,13 @@ import {
* @returns an absolute URL to the resource, if the absolute URL can be retrieved as singlepart,
* or is already retrieved, or a promise to a URL for such use if a BulkDataURI
*/
const getDirectURL = (wadoRoot, params) => {
const getDirectURL = (config, params) => {
const { wadoRoot, singlepart } = config;
const {
instance,
tag = 'PixelData',
defaultPath = '/pixeldata',
defaultType = 'video/mp4',
singlepart = null,
singlepart: fetchPart = 'video',
} = params;
const value = instance[tag];
@@ -53,11 +53,7 @@ const getDirectURL = (wadoRoot, params) => {
return undefined;
}
const {
StudyInstanceUID,
SeriesInstanceUID,
SOPInstanceUID,
} = instance;
const { StudyInstanceUID, SeriesInstanceUID, SOPInstanceUID } = instance;
const BulkDataURI =
(value && value.BulkDataURI) ||
`series/${SeriesInstanceUID}/instances/${SOPInstanceUID}${defaultPath}`;
@@ -66,7 +62,13 @@ const getDirectURL = (wadoRoot, params) => {
const acceptUri =
BulkDataURI +
(hasAccept ? '' : (hasQuery ? '&' : '?') + `accept=${defaultType}`);
if (BulkDataURI.indexOf('http') === 0) return acceptUri;
if (BulkDataURI.indexOf('http') === 0) {
if (tag === 'PixelData' || tag === 'EncapsulatedDocument') {
return `${wadoRoot}/studies/${StudyInstanceUID}/series/${SeriesInstanceUID}/instances/${SOPInstanceUID}/rendered`;
} else {
return acceptUri;
}
}
if (BulkDataURI.indexOf('/') === 0) {
return wadoRoot + acceptUri;
}