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