Fix contour annotations RTSS saving (#5545)
* [WIP] Fix contour annotations RTSS saving * fix: Export image sop image reference provider * Fixes for download with filename * Updates to fix metadata issues with CS3D * Updates to save menu * Fixing some additional re-save metadata * Add support for saving with predecessor image sequence * PR comment fixes * fix: Load RTSS after save * fix segmentation save * fix load of mixed seg/rt studies * Use frame module to get information on the frame shown * Fix study browser to use instances.length when numImageFrames not present * fix: Load of display set split from multiple non-FOR referenes * Fix RT and SEG applying to wrong series because of using referenced series sequence without checkout sop instances * Fix save seg * Update to released CS3D versions * test: Add revokeObjectURL to test download blob * Add hard dependency on mode-basic to fix build order issues * fix: build * Try to fix build segmentation * PR comments * PR comment update
This commit is contained in:
1 parent
9c5043ca2c
commit
57205703bb
68 files changed
+962
-648
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { ExtensionManager } from '../../extensions';
|
||||
import { DisplaySet, InstanceMetadata } from '../../types';
|
||||
import { DisplaySet, InstanceMetadata, ReferencedSeriesSequence } from '../../types';
|
||||
import { PubSubService } from '../_shared/pubSubServiceInterface';
|
||||
import EVENTS from './EVENTS';
|
||||
|
||||
@@ -115,16 +115,52 @@ export default class DisplaySetService extends PubSubService {
|
||||
return this.activeDisplaySets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the set of display sets with this series instance UID
|
||||
*
|
||||
* <b>WARNING: Do not use this method when you have a referenced series sequence
|
||||
* as this method does NOT check sop instances. Instead, use getDisplaySetsForReference
|
||||
* to get those with the correct sop instances in them.</b>
|
||||
*/
|
||||
public getDisplaySetsForSeries = (seriesInstanceUID: string): DisplaySet[] => {
|
||||
return [...displaySetCache.values()].filter(
|
||||
displaySet => displaySet.SeriesInstanceUID === seriesInstanceUID
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Given a reference to a series/sop, returns the set of display sets
|
||||
* containing an instance from the references.
|
||||
*/
|
||||
public getDisplaySetsForReferences = (
|
||||
references: ReferencedSeriesSequence | ReferencedSeriesSequence[]
|
||||
): DisplaySet[] => {
|
||||
const mapSeriesReferences = new Map<string, Set<string>>();
|
||||
const referenceArr = Array.isArray(references) ? references : [references];
|
||||
for (const seriesRef of referenceArr) {
|
||||
const { SeriesInstanceUID, ReferencedInstanceSequence } = seriesRef;
|
||||
if (!mapSeriesReferences.has(SeriesInstanceUID)) {
|
||||
mapSeriesReferences.set(SeriesInstanceUID, new Set<string>());
|
||||
}
|
||||
const sops = mapSeriesReferences.get(SeriesInstanceUID);
|
||||
for (const sopReference of ReferencedInstanceSequence) {
|
||||
sops.add(sopReference.ReferencedSOPInstanceUID);
|
||||
}
|
||||
}
|
||||
|
||||
return [...displaySetCache.values()].filter(displaySet => {
|
||||
const sopReferences = mapSeriesReferences.get(displaySet.SeriesInstanceUID);
|
||||
if (!sopReferences || !displaySet.instances) {
|
||||
return;
|
||||
}
|
||||
return displaySet.instances.some(instance => sopReferences.has(instance.SOPInstanceUID));
|
||||
});
|
||||
};
|
||||
|
||||
public getDisplaySetForSOPInstanceUID(
|
||||
sopInstanceUID: string,
|
||||
seriesInstanceUID: string,
|
||||
frameNumber?: number
|
||||
_frameNumber?: number
|
||||
): DisplaySet {
|
||||
const displaySets = seriesInstanceUID
|
||||
? this.getDisplaySetsForSeries(seriesInstanceUID)
|
||||
|
||||
Reference in new issue
Block a user