feat(OHIF):Add DICOM Video Display

* feat(OHIFv3):Add a video viewport

* Fixed a couple of viewing issues

* fix(OHIF):If not all instances are used by a given provider, then continue to add items

* Added video data

* Add a basic e2e test for video display

* Adding a screen shot as requested
This commit is contained in:
Bill Wallace authored and GitHub committed 2022-02-24 11:55:12 -05:00
1 parent 73aa738c48
commit ca9ed62a5f
19 files changed
+543 -5

No files matched your search

@@ -3,6 +3,31 @@ import EVENTS from './EVENTS';
const displaySetCache = [];
/**
* Find an instance in a list of instances, comparing by SOP instance UID
*/
const findInSet = (instance, list) => {
if (!list) return false;
for (const elem of list) {
if (!elem) continue;
if (elem === instance) return true;
if (elem.SOPInstanceUID === instance.SOPInstanceUID) return true;
}
return false;
};
/**
* Find an instance in a display set
* @returns true if found
*/
const findInstance = (instance, displaySets) => {
for (const displayset of displaySets) {
if (findInSet(instance, displayset.images)) return true;
if (findInSet(instance, displayset.others)) return true;
}
return false;
}
export default class DisplaySetService {
constructor() {
this.activeDisplaySets = [];
@@ -151,13 +176,15 @@ export default class DisplaySetService {
}
};
makeDisplaySetForInstances(instances, settings) {
makeDisplaySetForInstances(instancesSrc, settings) {
let instances = instancesSrc;
const instance = instances[0];
const existingDisplaySets =
this.getDisplaySetsForSeries(instance.SeriesInstanceUID) || [];
const SOPClassHandlerIds = this.SOPClassHandlerIds;
let allDisplaySets;
for (let i = 0; i < SOPClassHandlerIds.length; i++) {
const SOPClassHandlerId = SOPClassHandlerIds[i];
@@ -174,6 +201,8 @@ export default class DisplaySetService {
} else {
displaySets = handler.getDisplaySetsFromSeries(instances);
if (!displaySets || !displaySets.length) continue;
// applying hp-defined viewport settings to the displaysets
displaySets.forEach(ds => {
Object.keys(settings).forEach(key => {
@@ -183,10 +212,15 @@ export default class DisplaySetService {
this._addDisplaySetsToCache(displaySets);
this._addActiveDisplaySets(displaySets);
instances = instances.filter(instance => !findInstance(instance, displaySets))
}
return displaySets;
allDisplaySets = allDisplaySets ? [...allDisplaySets, ...displaySets] : displaySets;
if (!instances.length) return allDisplaySets;
}
}
return allDisplaySets;
}
}
@@ -0,0 +1,24 @@
describe('OHIF Video Display', function () {
before(() => {
cy.openStudyInViewer(
'2.25.96975534054447904995905761963464388233'
);
});
beforeEach(function () {
cy.resetViewport().wait(50);
});
it('checks if series thumbnails are being displayed', function () {
cy.get('[data-cy="study-browser-thumbnail"]')
.its('length')
.should('be.gt', 1);
});
it('performs double-click to load thumbnail in active viewport', () => {
cy.get('[data-cy="study-browser-thumbnail"]:nth-child(2)').dblclick();
//const expectedText = 'Ser: 3';
//cy.get('@viewportInfoBottomLeft').should('contains.text', expectedText);
});
});
+2
View File
@@ -23,6 +23,7 @@ import OHIFDefaultExtension from '@ohif/extension-default';
import OHIFCornerstoneExtension from '@ohif/extension-cornerstone';
import OHIFMeasurementTrackingExtension from '@ohif/extension-measurement-tracking';
import OHIFDICOMSRExtension from '@ohif/extension-dicom-sr';
import OHIFDICOMVIDEOExtension from '@ohif/extension-dicom-video';
/** Combine our appConfiguration and "baked-in" extensions */
const appProps = {
@@ -32,6 +33,7 @@ const appProps = {
OHIFCornerstoneExtension,
OHIFMeasurementTrackingExtension,
OHIFDICOMSRExtension,
OHIFDICOMVIDEOExtension,
],
};