fix(dicom-video): Update get direct func for dicom json to use url if present and fix config argument (#4017)
This commit is contained in:
parent
be9bb06565
commit
4f99244d86
@ -166,7 +166,7 @@ function createDicomJSONApi(dicomJsonConfig) {
|
||||
* or is already retrieved, or a promise to a URL for such use if a BulkDataURI
|
||||
*/
|
||||
directURL: params => {
|
||||
return getDirectURL(wadoRoot, params);
|
||||
return getDirectURL(dicomJsonConfig, params);
|
||||
},
|
||||
series: {
|
||||
metadata: async ({ StudyInstanceUID, madeInClient = false, customSort } = {}) => {
|
||||
|
||||
@ -10,6 +10,7 @@ import { utils } from '@ohif/core';
|
||||
* @param {string} params.defaultType is the mime type of the response
|
||||
* @param {string} params.singlepart is the type of the part to retrieve
|
||||
* @param {string} params.fetchPart unknown?
|
||||
* @param {string} params.url unknown?
|
||||
* @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
|
||||
*/
|
||||
@ -21,7 +22,12 @@ const getDirectURL = (config, params) => {
|
||||
defaultPath = '/pixeldata',
|
||||
defaultType = 'video/mp4',
|
||||
singlepart: fetchPart = 'video',
|
||||
url = null,
|
||||
} = params;
|
||||
if (url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
const value = instance[tag];
|
||||
if (!value) {
|
||||
return undefined;
|
||||
|
||||
@ -51,7 +51,7 @@ const _getDisplaySetsFromSeries = (instances, servicesManager, extensionManager)
|
||||
})
|
||||
.map(instance => {
|
||||
const { Modality, SOPInstanceUID, SeriesDescription = 'VIDEO' } = instance;
|
||||
const { SeriesNumber, SeriesDate, SeriesInstanceUID, StudyInstanceUID, NumberOfFrames } =
|
||||
const { SeriesNumber, SeriesDate, SeriesInstanceUID, StudyInstanceUID, NumberOfFrames, url } =
|
||||
instance;
|
||||
const displaySet = {
|
||||
//plugin: id,
|
||||
@ -70,6 +70,7 @@ const _getDisplaySetsFromSeries = (instances, servicesManager, extensionManager)
|
||||
instance,
|
||||
singlepart: 'video',
|
||||
tag: 'PixelData',
|
||||
url,
|
||||
}),
|
||||
instances: [instance],
|
||||
thumbnailSrc: dataSource.retrieve.directURL({
|
||||
|
||||
@ -6,7 +6,7 @@ import { utils } from '@ohif/core';
|
||||
const { formatDate, formatPN } = utils;
|
||||
|
||||
const formatWithEllipsis = (str, maxLength) => {
|
||||
if (str.length > maxLength) {
|
||||
if (str?.length > maxLength) {
|
||||
return str.substring(0, maxLength) + '...';
|
||||
}
|
||||
return str;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user