Skip to content

Commit

Permalink
fix(dicom-video): Update get direct func for dicom json to use url if…
Browse files Browse the repository at this point in the history
… present and fix config argument (#4017)
  • Loading branch information
igoroctaviano authored Apr 10, 2024
1 parent be9bb06 commit 4f99244
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion extensions/default/src/DicomJSONDataSource/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 } = {}) => {
Expand Down
6 changes: 6 additions & 0 deletions extensions/default/src/utils/getDirectURL.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion extensions/dicom-video/src/getSopClassHandlerModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -70,6 +70,7 @@ const _getDisplaySetsFromSeries = (instances, servicesManager, extensionManager)
instance,
singlepart: 'video',
tag: 'PixelData',
url,
}),
instances: [instance],
thumbnailSrc: dataSource.retrieve.directURL({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4f99244

Please sign in to comment.