fix(SR): KO series being displayed in browser list (#3382)
* fix: KO series being displayed in browser list * fix sr for volume viewports * move highlight labelmap to RAF * remove commented code * fix the hydration bug for the SR * apply review comments * revert the key images for sr * Remove some obsolete changes * set initial image for sr instead of jump * Remove viewportType stack --------- Co-authored-by: Alireza <ar.sedghi@gmail.com>
This commit is contained in:
1 parent
4172d0427b
commit
d5c5951e57
20 files changed
+243
-223
No files matched your search
@@ -82,13 +82,6 @@ function addInstances(
|
||||
// gets loaded, and to navigate among them.
|
||||
this.instance = this.instances[this.instances.length - 1];
|
||||
this.isLoaded = false;
|
||||
if (this.keyImageDisplaySet) {
|
||||
this.load();
|
||||
this.keyImageDisplaySet.updateInstances();
|
||||
displaySetService.setDisplaySetMetadataInvalidated(
|
||||
this.keyImageDisplaySet.displaySetInstanceUID
|
||||
);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ const findReferencedInstances = (
|
||||
const createReferencedImageDisplaySet = (displaySetService, displaySet) => {
|
||||
const instances = findReferencedInstances(displaySetService, displaySet);
|
||||
// This will be a member function of the created image set
|
||||
const updateInstances = function () {
|
||||
const updateInstances = function() {
|
||||
this.images.splice(
|
||||
0,
|
||||
this.images.length,
|
||||
@@ -78,6 +78,7 @@ const createReferencedImageDisplaySet = (displaySetService, displaySet) => {
|
||||
// This object is made of multiple instances from other series
|
||||
isCompositeStack: true,
|
||||
madeInClient: true,
|
||||
excludeFromThumbnailBrowser: true,
|
||||
updateInstances,
|
||||
});
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import { setTrackingUniqueIdentifiersForElement } from '../tools/modules/dicomSR
|
||||
|
||||
import { Icon, Tooltip, useViewportGrid, ViewportActionBar } from '@ohif/ui';
|
||||
import hydrateStructuredReport from '../utils/hydrateStructuredReport';
|
||||
import createReferencedImageDisplaySet from '../utils/createReferencedImageDisplaySet';
|
||||
|
||||
const { formatDate } = utils;
|
||||
|
||||
@@ -22,8 +21,8 @@ function OHIFCornerstoneSRViewport(props) {
|
||||
dataSource,
|
||||
displaySets,
|
||||
viewportIndex,
|
||||
viewportOptions,
|
||||
viewportLabel,
|
||||
viewportOptions,
|
||||
servicesManager,
|
||||
extensionManager,
|
||||
} = props;
|
||||
@@ -80,9 +79,9 @@ function OHIFCornerstoneSRViewport(props) {
|
||||
{ servicesManager, extensionManager },
|
||||
displaySetInstanceUID
|
||||
);
|
||||
const displaySets = srDisplaySet.keyImageDisplaySet
|
||||
? [srDisplaySet.keyImageDisplaySet]
|
||||
: displaySetService.getDisplaySetsForSeries(SeriesInstanceUIDs[0]);
|
||||
const displaySets = displaySetService.getDisplaySetsForSeries(
|
||||
SeriesInstanceUIDs[0]
|
||||
);
|
||||
if (displaySets.length) {
|
||||
viewportGridService.setDisplaySetsForViewports([
|
||||
{
|
||||
@@ -210,9 +209,19 @@ function OHIFCornerstoneSRViewport(props) {
|
||||
// should be passed second since we don't want SR displaySet to
|
||||
// override the activeImageDisplaySetData
|
||||
displaySets={[activeImageDisplaySetData]}
|
||||
// It is possible that there is a hanging protocol applying viewportOptions
|
||||
// for the SR, so inherit the viewport options
|
||||
// TODO: Ensure the viewport options are set correctly with respect to
|
||||
// stack etc, in the incoming viewport options.
|
||||
viewportOptions={{
|
||||
...viewportOptions,
|
||||
toolGroupId: `${SR_TOOLGROUP_BASE_NAME}`,
|
||||
// viewportType should not be required, as the stack type should be
|
||||
// required already in order to view SR, but sometimes segmentation
|
||||
// views set the viewport type without fixing the allowed display
|
||||
viewportType: 'stack',
|
||||
// The positionIds for the viewport aren't meaningful for the child display sets
|
||||
positionIds: null,
|
||||
}}
|
||||
onElementEnabled={onElementEnabled}
|
||||
initialImageIndex={initialImageIndex}
|
||||
@@ -420,18 +429,14 @@ async function _getViewportReferencedDisplaySetData(
|
||||
measurementSelected,
|
||||
displaySetService
|
||||
) {
|
||||
if (!displaySet.keyImageDisplaySet) {
|
||||
// Create a new display set, and preserve a reference to it here,
|
||||
// so that it can be re-displayed and shown inside the SR viewport.
|
||||
// This is only for ease of redisplay - the display set is stored in the
|
||||
// usual manner in the display set service.
|
||||
displaySet.keyImageDisplaySet = createReferencedImageDisplaySet(
|
||||
displaySetService,
|
||||
displaySet
|
||||
);
|
||||
}
|
||||
const { measurements } = displaySet;
|
||||
const measurement = measurements[measurementSelected];
|
||||
|
||||
const referencedDisplaySet = displaySet.keyImageDisplaySet;
|
||||
const { displaySetInstanceUID } = measurement;
|
||||
|
||||
const referencedDisplaySet = displaySetService.getDisplaySetByUID(
|
||||
displaySetInstanceUID
|
||||
);
|
||||
|
||||
const image0 = referencedDisplaySet.images[0];
|
||||
const referencedDisplaySetMetadata = {
|
||||
|
||||
Reference in new issue
Block a user