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:
Igor Octaviano 2024-04-10 11:55:19 -03:00 committed by GitHub
parent be9bb06565
commit 4f99244d86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 3 deletions

View File

@ -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 } = {}) => {

View File

@ -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;

View File

@ -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({

View File

@ -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;