chore(prettier): full repo linting and code reformatting once and for all (#3627)
This commit is contained in:
1 parent
01500a2d4c
commit
9045ddaedc
656 files changed
+21737
-20628
No files matched your search
+11
-43
@@ -1,16 +1,8 @@
|
||||
import { ServicesManager, Types } from '@ohif/core';
|
||||
import {
|
||||
cache as cs3DCache,
|
||||
Enums,
|
||||
volumeLoader,
|
||||
utilities as utils,
|
||||
} from '@cornerstonejs/core';
|
||||
import { cache as cs3DCache, Enums, volumeLoader, utilities as utils } from '@cornerstonejs/core';
|
||||
|
||||
import getCornerstoneViewportType from '../../utils/getCornerstoneViewportType';
|
||||
import {
|
||||
StackViewportData,
|
||||
VolumeViewportData,
|
||||
} from '../../types/CornerstoneCacheService';
|
||||
import { StackViewportData, VolumeViewportData } from '../../types/CornerstoneCacheService';
|
||||
|
||||
const VOLUME_LOADER_SCHEME = 'cornerstoneStreamingImageVolume';
|
||||
|
||||
@@ -18,9 +10,7 @@ class CornerstoneCacheService {
|
||||
static REGISTRATION = {
|
||||
name: 'cornerstoneCacheService',
|
||||
altName: 'CornerstoneCacheService',
|
||||
create: ({
|
||||
servicesManager,
|
||||
}: Types.Extensions.ExtensionParams): CornerstoneCacheService => {
|
||||
create: ({ servicesManager }: Types.Extensions.ExtensionParams): CornerstoneCacheService => {
|
||||
return new CornerstoneCacheService(servicesManager);
|
||||
},
|
||||
};
|
||||
@@ -77,11 +67,7 @@ class CornerstoneCacheService {
|
||||
cs3DViewportType === Enums.ViewportType.ORTHOGRAPHIC ||
|
||||
cs3DViewportType === Enums.ViewportType.VOLUME_3D
|
||||
) {
|
||||
viewportData = await this._getVolumeViewportData(
|
||||
dataSource,
|
||||
displaySets,
|
||||
cs3DViewportType
|
||||
);
|
||||
viewportData = await this._getVolumeViewportData(dataSource, displaySets, cs3DViewportType);
|
||||
}
|
||||
|
||||
viewportData.viewportType = cs3DViewportType;
|
||||
@@ -134,20 +120,14 @@ class CornerstoneCacheService {
|
||||
// For Stack Viewport we don't have fusion currently
|
||||
const displaySet = displaySets[0];
|
||||
|
||||
let stackImageIds = this.stackImageIds.get(
|
||||
displaySet.displaySetInstanceUID
|
||||
);
|
||||
let stackImageIds = this.stackImageIds.get(displaySet.displaySetInstanceUID);
|
||||
|
||||
if (!stackImageIds) {
|
||||
stackImageIds = this._getCornerstoneStackImageIds(displaySet, dataSource);
|
||||
this.stackImageIds.set(displaySet.displaySetInstanceUID, stackImageIds);
|
||||
}
|
||||
|
||||
const {
|
||||
displaySetInstanceUID,
|
||||
StudyInstanceUID,
|
||||
isCompositeStack,
|
||||
} = displaySet;
|
||||
const { displaySetInstanceUID, StudyInstanceUID, isCompositeStack } = displaySet;
|
||||
|
||||
const StackViewportData: StackViewportData = {
|
||||
viewportType,
|
||||
@@ -196,31 +176,22 @@ class CornerstoneCacheService {
|
||||
continue;
|
||||
}
|
||||
|
||||
const volumeLoaderSchema =
|
||||
displaySet.volumeLoaderSchema ?? VOLUME_LOADER_SCHEME;
|
||||
const volumeLoaderSchema = displaySet.volumeLoaderSchema ?? VOLUME_LOADER_SCHEME;
|
||||
|
||||
const volumeId = `${volumeLoaderSchema}:${displaySet.displaySetInstanceUID}`;
|
||||
|
||||
let volumeImageIds = this.volumeImageIds.get(
|
||||
displaySet.displaySetInstanceUID
|
||||
);
|
||||
let volumeImageIds = this.volumeImageIds.get(displaySet.displaySetInstanceUID);
|
||||
|
||||
let volume = cs3DCache.getVolume(volumeId);
|
||||
|
||||
if (!volumeImageIds || !volume) {
|
||||
volumeImageIds = this._getCornerstoneVolumeImageIds(
|
||||
displaySet,
|
||||
dataSource
|
||||
);
|
||||
volumeImageIds = this._getCornerstoneVolumeImageIds(displaySet, dataSource);
|
||||
|
||||
volume = await volumeLoader.createAndCacheVolume(volumeId, {
|
||||
imageIds: volumeImageIds,
|
||||
});
|
||||
|
||||
this.volumeImageIds.set(
|
||||
displaySet.displaySetInstanceUID,
|
||||
volumeImageIds
|
||||
);
|
||||
this.volumeImageIds.set(displaySet.displaySetInstanceUID, volumeImageIds);
|
||||
}
|
||||
|
||||
volumeData.push({
|
||||
@@ -268,10 +239,7 @@ class CornerstoneCacheService {
|
||||
}
|
||||
|
||||
private _getCornerstoneVolumeImageIds(displaySet, dataSource): string[] {
|
||||
const stackImageIds = this._getCornerstoneStackImageIds(
|
||||
displaySet,
|
||||
dataSource
|
||||
);
|
||||
const stackImageIds = this._getCornerstoneStackImageIds(displaySet, dataSource);
|
||||
|
||||
return stackImageIds;
|
||||
}
|
||||
|
||||
+19
-24
@@ -7,32 +7,27 @@
|
||||
* @returns An array of object that includes data, id, segmentIndex, color
|
||||
* and geometry Id
|
||||
*/
|
||||
export function mapROIContoursToRTStructData(
|
||||
structureSet: unknown,
|
||||
rtDisplaySetUID: unknown
|
||||
) {
|
||||
return structureSet.ROIContours.map(
|
||||
({ contourPoints, ROINumber, ROIName, colorArray }) => {
|
||||
const data = contourPoints.map(({ points, ...rest }) => {
|
||||
const newPoints = points.map(({ x, y, z }) => {
|
||||
return [x, y, z];
|
||||
});
|
||||
|
||||
return {
|
||||
...rest,
|
||||
points: newPoints,
|
||||
};
|
||||
export function mapROIContoursToRTStructData(structureSet: unknown, rtDisplaySetUID: unknown) {
|
||||
return structureSet.ROIContours.map(({ contourPoints, ROINumber, ROIName, colorArray }) => {
|
||||
const data = contourPoints.map(({ points, ...rest }) => {
|
||||
const newPoints = points.map(({ x, y, z }) => {
|
||||
return [x, y, z];
|
||||
});
|
||||
|
||||
const id = ROIName || ROINumber;
|
||||
|
||||
return {
|
||||
data,
|
||||
id,
|
||||
segmentIndex: ROINumber,
|
||||
color: colorArray,
|
||||
geometryId: `${rtDisplaySetUID}:${id}:segmentIndex-${ROINumber}`,
|
||||
...rest,
|
||||
points: newPoints,
|
||||
};
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
const id = ROIName || ROINumber;
|
||||
|
||||
return {
|
||||
data,
|
||||
id,
|
||||
segmentIndex: ROINumber,
|
||||
color: colorArray,
|
||||
geometryId: `${rtDisplaySetUID}:${id}:segmentIndex-${ROINumber}`,
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -21,11 +21,7 @@ import {
|
||||
import isEqual from 'lodash.isequal';
|
||||
import { Types as ohifTypes } from '@ohif/core';
|
||||
import { easeInOutBell, reverseEaseInOutBell } from '../../utils/transitions';
|
||||
import {
|
||||
Segment,
|
||||
Segmentation,
|
||||
SegmentationConfig,
|
||||
} from './SegmentationServiceTypes';
|
||||
import { Segment, Segmentation, SegmentationConfig } from './SegmentationServiceTypes';
|
||||
import { mapROIContoursToRTStructData } from './RTSTRUCT/mapROIContoursToRTStructData';
|
||||
|
||||
const { COLOR_LUT } = cstConstants;
|
||||
@@ -42,8 +38,7 @@ const EVENTS = {
|
||||
// fired when the segmentation is removed
|
||||
SEGMENTATION_REMOVED: 'event::segmentation_removed',
|
||||
// fired when the configuration for the segmentation is changed (e.g., brush size, render fill, outline thickness, etc.)
|
||||
SEGMENTATION_CONFIGURATION_CHANGED:
|
||||
'event::segmentation_configuration_changed',
|
||||
SEGMENTATION_CONFIGURATION_CHANGED: 'event::segmentation_configuration_changed',
|
||||
// fired when the active segment is loaded in SEG or RTSTRUCT
|
||||
SEGMENT_LOADING_COMPLETE: 'event::segment_loading_complete',
|
||||
// for all segments
|
||||
@@ -64,9 +59,7 @@ class SegmentationService extends PubSubService {
|
||||
static REGISTRATION = {
|
||||
name: 'segmentationService',
|
||||
altName: 'SegmentationService',
|
||||
create: ({
|
||||
servicesManager,
|
||||
}: OhifTypes.Extensions.ExtensionParams): SegmentationService => {
|
||||
create: ({ servicesManager }: OhifTypes.Extensions.ExtensionParams): SegmentationService => {
|
||||
return new SegmentationService({ servicesManager });
|
||||
},
|
||||
};
|
||||
@@ -138,10 +131,10 @@ class SegmentationService extends PubSubService {
|
||||
|
||||
toolGroupId = toolGroupId ?? this._getFirstToolGroupId();
|
||||
|
||||
const {
|
||||
segmentationRepresentationUID,
|
||||
segmentation,
|
||||
} = this._getSegmentationInfo(segmentationId, toolGroupId);
|
||||
const { segmentationRepresentationUID, segmentation } = this._getSegmentationInfo(
|
||||
segmentationId,
|
||||
toolGroupId
|
||||
);
|
||||
|
||||
if (this._getSegmentInfo(segmentation, segmentIndex)) {
|
||||
throw new Error(`Segment ${segmentIndex} already exists`);
|
||||
@@ -166,32 +159,14 @@ class SegmentationService extends PubSubService {
|
||||
|
||||
const suppressEvents = true;
|
||||
if (properties !== undefined) {
|
||||
const {
|
||||
color: newColor,
|
||||
opacity,
|
||||
isLocked,
|
||||
visibility,
|
||||
active,
|
||||
} = properties;
|
||||
const { color: newColor, opacity, isLocked, visibility, active } = properties;
|
||||
|
||||
if (newColor !== undefined) {
|
||||
this._setSegmentColor(
|
||||
segmentationId,
|
||||
segmentIndex,
|
||||
newColor,
|
||||
toolGroupId,
|
||||
suppressEvents
|
||||
);
|
||||
this._setSegmentColor(segmentationId, segmentIndex, newColor, toolGroupId, suppressEvents);
|
||||
}
|
||||
|
||||
if (opacity !== undefined) {
|
||||
this._setSegmentOpacity(
|
||||
segmentationId,
|
||||
segmentIndex,
|
||||
opacity,
|
||||
toolGroupId,
|
||||
suppressEvents
|
||||
);
|
||||
this._setSegmentOpacity(segmentationId, segmentIndex, opacity, toolGroupId, suppressEvents);
|
||||
}
|
||||
|
||||
if (visibility !== undefined) {
|
||||
@@ -209,12 +184,7 @@ class SegmentationService extends PubSubService {
|
||||
}
|
||||
|
||||
if (isLocked !== undefined) {
|
||||
this._setSegmentLocked(
|
||||
segmentationId,
|
||||
segmentIndex,
|
||||
isLocked,
|
||||
suppressEvents
|
||||
);
|
||||
this._setSegmentLocked(segmentationId, segmentIndex, isLocked, suppressEvents);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,9 +255,7 @@ class SegmentationService extends PubSubService {
|
||||
if (segmentation.activeSegmentIndex === segmentIndex) {
|
||||
const segmentIndices = Object.keys(segmentation.segments);
|
||||
|
||||
const newActiveSegmentIndex = segmentIndices.length
|
||||
? Number(segmentIndices[0])
|
||||
: 1;
|
||||
const newActiveSegmentIndex = segmentIndices.length ? Number(segmentIndices[0]) : 1;
|
||||
|
||||
this._setActiveSegment(segmentationId, newActiveSegmentIndex, true);
|
||||
}
|
||||
@@ -319,19 +287,10 @@ class SegmentationService extends PubSubService {
|
||||
isLocked: boolean
|
||||
): void {
|
||||
const suppressEvents = false;
|
||||
this._setSegmentLocked(
|
||||
segmentationId,
|
||||
segmentIndex,
|
||||
isLocked,
|
||||
suppressEvents
|
||||
);
|
||||
this._setSegmentLocked(segmentationId, segmentIndex, isLocked, suppressEvents);
|
||||
}
|
||||
|
||||
public setSegmentLabel(
|
||||
segmentationId: string,
|
||||
segmentIndex: number,
|
||||
segmentLabel: string
|
||||
): void {
|
||||
public setSegmentLabel(segmentationId: string, segmentIndex: number, segmentLabel: string): void {
|
||||
this._setSegmentLabel(segmentationId, segmentIndex, segmentLabel);
|
||||
}
|
||||
|
||||
@@ -387,24 +346,14 @@ class SegmentationService extends PubSubService {
|
||||
this._setSegmentOpacity(segmentationId, segmentIndex, opacity, toolGroupId);
|
||||
}
|
||||
|
||||
public setActiveSegmentationForToolGroup(
|
||||
segmentationId: string,
|
||||
toolGroupId?: string
|
||||
): void {
|
||||
public setActiveSegmentationForToolGroup(segmentationId: string, toolGroupId?: string): void {
|
||||
toolGroupId = toolGroupId ?? this._getFirstToolGroupId();
|
||||
|
||||
const suppressEvents = false;
|
||||
this._setActiveSegmentationForToolGroup(
|
||||
segmentationId,
|
||||
toolGroupId,
|
||||
suppressEvents
|
||||
);
|
||||
this._setActiveSegmentationForToolGroup(segmentationId, toolGroupId, suppressEvents);
|
||||
}
|
||||
|
||||
public setActiveSegmentForSegmentation(
|
||||
segmentationId: string,
|
||||
segmentIndex: number
|
||||
): void {
|
||||
public setActiveSegmentForSegmentation(segmentationId: string, segmentIndex: number): void {
|
||||
this._setActiveSegment(segmentationId, segmentIndex, false);
|
||||
}
|
||||
|
||||
@@ -420,9 +369,7 @@ class SegmentationService extends PubSubService {
|
||||
|
||||
* @return Array of segmentations
|
||||
*/
|
||||
public getSegmentations(
|
||||
filterNonHydratedSegmentations = true
|
||||
): Segmentation[] {
|
||||
public getSegmentations(filterNonHydratedSegmentations = true): Segmentation[] {
|
||||
const segmentations = this._getSegmentations();
|
||||
|
||||
return (
|
||||
@@ -435,10 +382,7 @@ class SegmentationService extends PubSubService {
|
||||
|
||||
private _getSegmentations(): Segmentation[] {
|
||||
const segmentations = this.arrayOfObjects(this.segmentations);
|
||||
return (
|
||||
segmentations &&
|
||||
segmentations.map(m => this.segmentations[Object.keys(m)[0]])
|
||||
);
|
||||
return segmentations && segmentations.map(m => this.segmentations[Object.keys(m)[0]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -477,8 +421,7 @@ class SegmentationService extends PubSubService {
|
||||
}
|
||||
|
||||
const representationType = segmentation.type;
|
||||
const representationData =
|
||||
segmentation.representationData[representationType];
|
||||
const representationData = segmentation.representationData[representationType];
|
||||
cstSegmentation.addSegmentations([
|
||||
{
|
||||
segmentationId,
|
||||
@@ -566,9 +509,7 @@ class SegmentationService extends PubSubService {
|
||||
const { labelmapBufferArray, referencedVolumeId } = segDisplaySet;
|
||||
|
||||
if (!labelmapBufferArray || !referencedVolumeId) {
|
||||
throw new Error(
|
||||
'No labelmapBufferArray or referencedVolumeId found for the SEG displaySet'
|
||||
);
|
||||
throw new Error('No labelmapBufferArray or referencedVolumeId found for the SEG displaySet');
|
||||
}
|
||||
|
||||
// if the labelmap doesn't exist, we need to create it first from the
|
||||
@@ -576,23 +517,18 @@ class SegmentationService extends PubSubService {
|
||||
const referencedVolume = cache.getVolume(referencedVolumeId);
|
||||
|
||||
if (!referencedVolume) {
|
||||
throw new Error(
|
||||
`No volume found for referencedVolumeId: ${referencedVolumeId}`
|
||||
);
|
||||
throw new Error(`No volume found for referencedVolumeId: ${referencedVolumeId}`);
|
||||
}
|
||||
|
||||
// Force use of a Uint8Array SharedArrayBuffer for the segmentation to save space and so
|
||||
// it is easily compressible in worker thread.
|
||||
const derivedVolume = await volumeLoader.createAndCacheDerivedVolume(
|
||||
referencedVolumeId,
|
||||
{
|
||||
volumeId: segmentationId,
|
||||
targetBuffer: {
|
||||
type: 'Uint8Array',
|
||||
sharedArrayBuffer: true,
|
||||
},
|
||||
}
|
||||
);
|
||||
const derivedVolume = await volumeLoader.createAndCacheDerivedVolume(referencedVolumeId, {
|
||||
volumeId: segmentationId,
|
||||
targetBuffer: {
|
||||
type: 'Uint8Array',
|
||||
sharedArrayBuffer: true,
|
||||
},
|
||||
});
|
||||
const derivedVolumeScalarData = derivedVolume.getScalarData();
|
||||
|
||||
const segmentsInfo = segDisplaySet.segMetadata.data;
|
||||
@@ -680,10 +616,7 @@ class SegmentationService extends PubSubService {
|
||||
const defaultScheme = this._getDefaultSegmentationScheme();
|
||||
const rtDisplaySetUID = rtDisplaySet.displaySetInstanceUID;
|
||||
|
||||
const allRTStructData = mapROIContoursToRTStructData(
|
||||
structureSet,
|
||||
rtDisplaySetUID
|
||||
);
|
||||
const allRTStructData = mapROIContoursToRTStructData(structureSet, rtDisplaySetUID);
|
||||
|
||||
// sort by segmentIndex
|
||||
allRTStructData.sort((a, b) => a.segmentIndex - b.segmentIndex);
|
||||
@@ -726,19 +659,16 @@ class SegmentationService extends PubSubService {
|
||||
|
||||
// catch error instead of failing to allow loading to continue
|
||||
try {
|
||||
const geometry = await geometryLoader.createAndCacheGeometry(
|
||||
geometryId,
|
||||
{
|
||||
geometryData: {
|
||||
data,
|
||||
id,
|
||||
color,
|
||||
frameOfReferenceUID: structureSet.frameOfReferenceUID,
|
||||
segmentIndex,
|
||||
},
|
||||
type: csEnums.GeometryType.CONTOUR,
|
||||
}
|
||||
);
|
||||
const geometry = await geometryLoader.createAndCacheGeometry(geometryId, {
|
||||
geometryData: {
|
||||
data,
|
||||
id,
|
||||
color,
|
||||
frameOfReferenceUID: structureSet.frameOfReferenceUID,
|
||||
segmentIndex,
|
||||
},
|
||||
type: csEnums.GeometryType.CONTOUR,
|
||||
});
|
||||
|
||||
const contourSet = geometry.data;
|
||||
const centroid = contourSet.getCentroid();
|
||||
@@ -758,9 +688,7 @@ class SegmentationService extends PubSubService {
|
||||
const numInitialized = Object.keys(segmentsCachedStats).length;
|
||||
|
||||
// Calculate percentage completed
|
||||
const percentComplete = Math.round(
|
||||
(numInitialized / allRTStructData.length) * 100
|
||||
);
|
||||
const percentComplete = Math.round((numInitialized / allRTStructData.length) * 100);
|
||||
|
||||
this._broadcastEvent(EVENTS.SEGMENT_LOADING_COMPLETE, {
|
||||
percentComplete,
|
||||
@@ -824,8 +752,7 @@ class SegmentationService extends PubSubService {
|
||||
const { world } = center;
|
||||
|
||||
// todo: generalize
|
||||
toolGroupId =
|
||||
toolGroupId || this._getToolGroupIdsWithSegmentation(segmentationId);
|
||||
toolGroupId = toolGroupId || this._getToolGroupIdsWithSegmentation(segmentationId);
|
||||
|
||||
const toolGroups = [];
|
||||
|
||||
@@ -842,10 +769,7 @@ class SegmentationService extends PubSubService {
|
||||
|
||||
// @ts-ignore
|
||||
for (const { viewportId, renderingEngineId } of viewportsInfo) {
|
||||
const { viewport } = getEnabledElementByIds(
|
||||
viewportId,
|
||||
renderingEngineId
|
||||
);
|
||||
const { viewport } = getEnabledElementByIds(viewportId, renderingEngineId);
|
||||
cstUtils.viewport.jumpToWorld(viewport, world);
|
||||
}
|
||||
|
||||
@@ -888,9 +812,7 @@ class SegmentationService extends PubSubService {
|
||||
const { segments } = segmentation;
|
||||
|
||||
const highlightFn =
|
||||
type === LABELMAP
|
||||
? this._highlightLabelmap.bind(this)
|
||||
: this._highlightContour.bind(this);
|
||||
type === LABELMAP ? this._highlightLabelmap.bind(this) : this._highlightContour.bind(this);
|
||||
|
||||
const adjustedAlpha = type === LABELMAP ? alpha : 1 - alpha;
|
||||
|
||||
@@ -914,9 +836,7 @@ class SegmentationService extends PubSubService {
|
||||
): Promise<string> => {
|
||||
const { displaySetService } = this.servicesManager.services;
|
||||
|
||||
const displaySet = displaySetService.getDisplaySetByUID(
|
||||
displaySetInstanceUID
|
||||
);
|
||||
const displaySet = displaySetService.getDisplaySetByUID(displaySetInstanceUID);
|
||||
|
||||
// Todo: we currently only support labelmap for segmentation for a displaySet
|
||||
const representationType = LABELMAP;
|
||||
@@ -977,9 +897,7 @@ class SegmentationService extends PubSubService {
|
||||
const segmentation = this.getSegmentation(segmentationId);
|
||||
|
||||
if (!segmentation) {
|
||||
throw new Error(
|
||||
`Segmentation with segmentationId ${segmentationId} not found.`
|
||||
);
|
||||
throw new Error(`Segmentation with segmentationId ${segmentationId} not found.`);
|
||||
}
|
||||
|
||||
if (hydrateSegmentation) {
|
||||
@@ -1019,34 +937,16 @@ class SegmentationService extends PubSubService {
|
||||
continue;
|
||||
}
|
||||
|
||||
const {
|
||||
segmentIndex,
|
||||
color,
|
||||
isLocked,
|
||||
isVisible: visibility,
|
||||
opacity,
|
||||
} = segment;
|
||||
const { segmentIndex, color, isLocked, isVisible: visibility, opacity } = segment;
|
||||
|
||||
const suppressEvents = true;
|
||||
|
||||
if (color !== undefined) {
|
||||
this._setSegmentColor(
|
||||
segmentationId,
|
||||
segmentIndex,
|
||||
color,
|
||||
toolGroupId,
|
||||
suppressEvents
|
||||
);
|
||||
this._setSegmentColor(segmentationId, segmentIndex, color, toolGroupId, suppressEvents);
|
||||
}
|
||||
|
||||
if (opacity !== undefined) {
|
||||
this._setSegmentOpacity(
|
||||
segmentationId,
|
||||
segmentIndex,
|
||||
opacity,
|
||||
toolGroupId,
|
||||
suppressEvents
|
||||
);
|
||||
this._setSegmentOpacity(segmentationId, segmentIndex, opacity, toolGroupId, suppressEvents);
|
||||
}
|
||||
|
||||
if (visibility !== undefined) {
|
||||
@@ -1060,12 +960,7 @@ class SegmentationService extends PubSubService {
|
||||
}
|
||||
|
||||
if (isLocked !== undefined) {
|
||||
this._setSegmentLocked(
|
||||
segmentationId,
|
||||
segmentIndex,
|
||||
isLocked,
|
||||
suppressEvents
|
||||
);
|
||||
this._setSegmentLocked(segmentationId, segmentIndex, isLocked, suppressEvents);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1102,25 +997,16 @@ class SegmentationService extends PubSubService {
|
||||
});
|
||||
};
|
||||
|
||||
public getToolGroupIdsWithSegmentation = (
|
||||
segmentationId: string
|
||||
): string[] => {
|
||||
const toolGroupIds = cstSegmentation.state.getToolGroupIdsWithSegmentation(
|
||||
segmentationId
|
||||
);
|
||||
public getToolGroupIdsWithSegmentation = (segmentationId: string): string[] => {
|
||||
const toolGroupIds = cstSegmentation.state.getToolGroupIdsWithSegmentation(segmentationId);
|
||||
return toolGroupIds;
|
||||
};
|
||||
|
||||
public hydrateSegmentation = (
|
||||
segmentationId: string,
|
||||
suppressEvents = false
|
||||
): void => {
|
||||
public hydrateSegmentation = (segmentationId: string, suppressEvents = false): void => {
|
||||
const segmentation = this.getSegmentation(segmentationId);
|
||||
|
||||
if (!segmentation) {
|
||||
throw new Error(
|
||||
`Segmentation with segmentationId ${segmentationId} not found.`
|
||||
);
|
||||
throw new Error(`Segmentation with segmentationId ${segmentationId} not found.`);
|
||||
}
|
||||
|
||||
this._setDisplaySetIsHydrated(segmentationId, true);
|
||||
@@ -1134,13 +1020,8 @@ class SegmentationService extends PubSubService {
|
||||
}
|
||||
};
|
||||
|
||||
private _setDisplaySetIsHydrated(
|
||||
displaySetUID: string,
|
||||
isHydrated: boolean
|
||||
): void {
|
||||
const {
|
||||
DisplaySetService: displaySetService,
|
||||
} = this.servicesManager.services;
|
||||
private _setDisplaySetIsHydrated(displaySetUID: string, isHydrated: boolean): void {
|
||||
const { DisplaySetService: displaySetService } = this.servicesManager.services;
|
||||
const displaySet = displaySetService.getDisplaySetByUID(displaySetUID);
|
||||
displaySet.isHydrated = isHydrated;
|
||||
displaySetService.setDisplaySetMetadataInvalidated(displaySetUID, false);
|
||||
@@ -1259,17 +1140,13 @@ class SegmentationService extends PubSubService {
|
||||
): void {
|
||||
const uids = segmentationRepresentationUIDsIds || [];
|
||||
if (!uids.length) {
|
||||
const representations = cstSegmentation.state.getSegmentationRepresentations(
|
||||
toolGroupId
|
||||
);
|
||||
const representations = cstSegmentation.state.getSegmentationRepresentations(toolGroupId);
|
||||
|
||||
if (!representations || !representations.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
uids.push(
|
||||
...representations.map(rep => rep.segmentationRepresentationUID)
|
||||
);
|
||||
uids.push(...representations.map(rep => rep.segmentationRepresentationUID));
|
||||
}
|
||||
|
||||
cstSegmentation.removeSegmentationsFromToolGroup(toolGroupId, uids);
|
||||
@@ -1285,9 +1162,7 @@ class SegmentationService extends PubSubService {
|
||||
const wasActive = segmentation.isActive;
|
||||
|
||||
if (!segmentationId || !segmentation) {
|
||||
console.warn(
|
||||
`No segmentationId provided, or unable to find segmentation by id.`
|
||||
);
|
||||
console.warn(`No segmentationId provided, or unable to find segmentation by id.`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1309,11 +1184,7 @@ class SegmentationService extends PubSubService {
|
||||
if (remainingSegmentations.length) {
|
||||
const { id } = remainingSegmentations[0];
|
||||
|
||||
this._setActiveSegmentationForToolGroup(
|
||||
id,
|
||||
this._getFirstToolGroupId(),
|
||||
false
|
||||
);
|
||||
this._setActiveSegmentationForToolGroup(id, this._getFirstToolGroupId(), false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1337,9 +1208,8 @@ class SegmentationService extends PubSubService {
|
||||
// toolGroupId
|
||||
// );
|
||||
|
||||
const segmentationRepresentations = this.getSegmentationRepresentationsForToolGroup(
|
||||
toolGroupId
|
||||
);
|
||||
const segmentationRepresentations =
|
||||
this.getSegmentationRepresentationsForToolGroup(toolGroupId);
|
||||
|
||||
const typeToUse = segmentationRepresentations?.[0]?.type || LABELMAP;
|
||||
|
||||
@@ -1397,11 +1267,7 @@ class SegmentationService extends PubSubService {
|
||||
setConfigValueIfDefined('outlineOpacity', outlineOpacity, v => v / 100);
|
||||
setConfigValueIfDefined('fillAlpha', fillAlpha, v => v / 100);
|
||||
setConfigValueIfDefined('renderFill', renderFill);
|
||||
setConfigValueIfDefined(
|
||||
'fillAlphaInactive',
|
||||
fillAlphaInactive,
|
||||
v => v / 100
|
||||
);
|
||||
setConfigValueIfDefined('fillAlphaInactive', fillAlphaInactive, v => v / 100);
|
||||
setConfigValueIfDefined('outlineOpacityInactive', fillAlphaInactive, v =>
|
||||
Math.max(0.75, v / 100)
|
||||
);
|
||||
@@ -1435,10 +1301,7 @@ class SegmentationService extends PubSubService {
|
||||
// });
|
||||
// }
|
||||
|
||||
this._broadcastEvent(
|
||||
this.EVENTS.SEGMENTATION_CONFIGURATION_CHANGED,
|
||||
this.getConfiguration()
|
||||
);
|
||||
this._broadcastEvent(this.EVENTS.SEGMENTATION_CONFIGURATION_CHANGED, this.getConfiguration());
|
||||
};
|
||||
|
||||
public getLabelmapVolume = (segmentationId: string) => {
|
||||
@@ -1472,9 +1335,7 @@ class SegmentationService extends PubSubService {
|
||||
const segmentInfo = segmentation.segments[segmentIndex];
|
||||
|
||||
if (segmentInfo === undefined) {
|
||||
throw new Error(
|
||||
`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`
|
||||
);
|
||||
throw new Error(`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`);
|
||||
}
|
||||
|
||||
segmentInfo.label = label;
|
||||
@@ -1487,14 +1348,8 @@ class SegmentationService extends PubSubService {
|
||||
}
|
||||
}
|
||||
|
||||
public shouldRenderSegmentation(
|
||||
viewportDisplaySetInstanceUIDs,
|
||||
segDisplaySetInstanceUID
|
||||
) {
|
||||
if (
|
||||
!viewportDisplaySetInstanceUIDs ||
|
||||
!viewportDisplaySetInstanceUIDs.length
|
||||
) {
|
||||
public shouldRenderSegmentation(viewportDisplaySetInstanceUIDs, segDisplaySetInstanceUID) {
|
||||
if (!viewportDisplaySetInstanceUIDs || !viewportDisplaySetInstanceUIDs.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1502,20 +1357,14 @@ class SegmentationService extends PubSubService {
|
||||
|
||||
let shouldDisplaySeg = false;
|
||||
|
||||
const segDisplaySet = displaySetService.getDisplaySetByUID(
|
||||
segDisplaySetInstanceUID
|
||||
);
|
||||
const segDisplaySet = displaySetService.getDisplaySetByUID(segDisplaySetInstanceUID);
|
||||
|
||||
const segFrameOfReferenceUID = this._getFrameOfReferenceUIDForSeg(
|
||||
segDisplaySet
|
||||
);
|
||||
const segFrameOfReferenceUID = this._getFrameOfReferenceUIDForSeg(segDisplaySet);
|
||||
|
||||
// check if the displaySet is sharing the same frameOfReferenceUID
|
||||
// with the new segmentation
|
||||
for (const displaySetInstanceUID of viewportDisplaySetInstanceUIDs) {
|
||||
const displaySet = displaySetService.getDisplaySetByUID(
|
||||
displaySetInstanceUID
|
||||
);
|
||||
const displaySet = displaySetService.getDisplaySetByUID(displaySetInstanceUID);
|
||||
|
||||
// Todo: this might not be ideal for use cases such as 4D, since we
|
||||
// don't want to show the segmentation for all the frames
|
||||
@@ -1563,10 +1412,7 @@ class SegmentationService extends PubSubService {
|
||||
segmentation.isActive = segmentation.id === segmentationId;
|
||||
});
|
||||
|
||||
const representation = this._getSegmentationRepresentation(
|
||||
segmentationId,
|
||||
toolGroupId
|
||||
);
|
||||
const representation = this._getSegmentationRepresentation(segmentationId, toolGroupId);
|
||||
|
||||
cstSegmentation.activeSegmentation.setActiveSegmentationRepresentation(
|
||||
toolGroupId,
|
||||
@@ -1580,16 +1426,11 @@ class SegmentationService extends PubSubService {
|
||||
}
|
||||
}
|
||||
|
||||
private _toggleSegmentationVisibility = (
|
||||
segmentationId: string,
|
||||
suppressEvents = false
|
||||
) => {
|
||||
private _toggleSegmentationVisibility = (segmentationId: string, suppressEvents = false) => {
|
||||
const segmentation = this.segmentations[segmentationId];
|
||||
|
||||
if (!segmentation) {
|
||||
throw new Error(
|
||||
`Segmentation with segmentationId ${segmentationId} not found.`
|
||||
);
|
||||
throw new Error(`Segmentation with segmentationId ${segmentationId} not found.`);
|
||||
}
|
||||
|
||||
segmentation.isVisible = !segmentation.isVisible;
|
||||
@@ -1603,21 +1444,14 @@ class SegmentationService extends PubSubService {
|
||||
}
|
||||
};
|
||||
|
||||
private _setActiveSegment(
|
||||
segmentationId: string,
|
||||
segmentIndex: number,
|
||||
suppressEvents = false
|
||||
) {
|
||||
private _setActiveSegment(segmentationId: string, segmentIndex: number, suppressEvents = false) {
|
||||
const segmentation = this.getSegmentation(segmentationId);
|
||||
|
||||
if (segmentation === undefined) {
|
||||
throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
|
||||
}
|
||||
|
||||
cstSegmentation.segmentIndex.setActiveSegmentIndex(
|
||||
segmentationId,
|
||||
segmentIndex
|
||||
);
|
||||
cstSegmentation.segmentIndex.setActiveSegmentIndex(segmentationId, segmentIndex);
|
||||
|
||||
segmentation.activeSegmentIndex = segmentIndex;
|
||||
|
||||
@@ -1641,8 +1475,7 @@ class SegmentationService extends PubSubService {
|
||||
}
|
||||
|
||||
private _getVolumeIdForDisplaySet(displaySet) {
|
||||
const volumeLoaderSchema =
|
||||
displaySet.volumeLoaderSchema ?? VOLUME_LOADER_SCHEME;
|
||||
const volumeLoaderSchema = displaySet.volumeLoaderSchema ?? VOLUME_LOADER_SCHEME;
|
||||
|
||||
return `${volumeLoaderSchema}:${displaySet.displaySetInstanceUID}`;
|
||||
}
|
||||
@@ -1663,9 +1496,7 @@ class SegmentationService extends PubSubService {
|
||||
const segmentInfo = this._getSegmentInfo(segmentation, segmentIndex);
|
||||
|
||||
if (segmentInfo === undefined) {
|
||||
throw new Error(
|
||||
`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`
|
||||
);
|
||||
throw new Error(`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`);
|
||||
}
|
||||
|
||||
toolGroupId = toolGroupId ?? this._getFirstToolGroupId();
|
||||
@@ -1676,9 +1507,7 @@ class SegmentationService extends PubSubService {
|
||||
);
|
||||
|
||||
if (!segmentationRepresentation) {
|
||||
throw new Error(
|
||||
'Must add representation to toolgroup before setting segments'
|
||||
);
|
||||
throw new Error('Must add representation to toolgroup before setting segments');
|
||||
}
|
||||
const { segmentationRepresentationUID } = segmentationRepresentation;
|
||||
|
||||
@@ -1743,18 +1572,12 @@ class SegmentationService extends PubSubService {
|
||||
const segmentInfo = this._getSegmentInfo(segmentation, segmentIndex);
|
||||
|
||||
if (segmentInfo === undefined) {
|
||||
throw new Error(
|
||||
`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`
|
||||
);
|
||||
throw new Error(`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`);
|
||||
}
|
||||
|
||||
segmentInfo.isLocked = isLocked;
|
||||
|
||||
cstSegmentation.segmentLocking.setSegmentIndexLocked(
|
||||
segmentationId,
|
||||
segmentIndex,
|
||||
isLocked
|
||||
);
|
||||
cstSegmentation.segmentLocking.setSegmentIndexLocked(segmentationId, segmentIndex, isLocked);
|
||||
|
||||
if (suppressEvents === false) {
|
||||
this._broadcastEvent(this.EVENTS.SEGMENTATION_UPDATED, {
|
||||
@@ -1772,10 +1595,10 @@ class SegmentationService extends PubSubService {
|
||||
) {
|
||||
toolGroupId = toolGroupId ?? this._getFirstToolGroupId();
|
||||
|
||||
const {
|
||||
segmentationRepresentationUID,
|
||||
segmentation,
|
||||
} = this._getSegmentationInfo(segmentationId, toolGroupId);
|
||||
const { segmentationRepresentationUID, segmentation } = this._getSegmentationInfo(
|
||||
segmentationId,
|
||||
toolGroupId
|
||||
);
|
||||
|
||||
if (segmentation === undefined) {
|
||||
throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
|
||||
@@ -1784,9 +1607,7 @@ class SegmentationService extends PubSubService {
|
||||
const segmentInfo = this._getSegmentInfo(segmentation, segmentIndex);
|
||||
|
||||
if (segmentInfo === undefined) {
|
||||
throw new Error(
|
||||
`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`
|
||||
);
|
||||
throw new Error(`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`);
|
||||
}
|
||||
|
||||
segmentInfo.isVisible = isVisible;
|
||||
@@ -1828,9 +1649,7 @@ class SegmentationService extends PubSubService {
|
||||
const segmentInfo = this._getSegmentInfo(segmentation, segmentIndex);
|
||||
|
||||
if (segmentInfo === undefined) {
|
||||
throw new Error(
|
||||
`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`
|
||||
);
|
||||
throw new Error(`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`);
|
||||
}
|
||||
|
||||
toolGroupId = toolGroupId ?? this._getFirstToolGroupId();
|
||||
@@ -1841,9 +1660,7 @@ class SegmentationService extends PubSubService {
|
||||
);
|
||||
|
||||
if (!segmentationRepresentation) {
|
||||
throw new Error(
|
||||
'Must add representation to toolgroup before setting segments'
|
||||
);
|
||||
throw new Error('Must add representation to toolgroup before setting segments');
|
||||
}
|
||||
const { segmentationRepresentationUID } = segmentationRepresentation;
|
||||
|
||||
@@ -1884,9 +1701,7 @@ class SegmentationService extends PubSubService {
|
||||
const segmentInfo = this._getSegmentInfo(segmentation, segmentIndex);
|
||||
|
||||
if (segmentInfo === undefined) {
|
||||
throw new Error(
|
||||
`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`
|
||||
);
|
||||
throw new Error(`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`);
|
||||
}
|
||||
|
||||
segmentInfo.label = segmentLabel;
|
||||
@@ -1899,9 +1714,8 @@ class SegmentationService extends PubSubService {
|
||||
}
|
||||
|
||||
private _getSegmentationRepresentation(segmentationId, toolGroupId) {
|
||||
const segmentationRepresentations = this.getSegmentationRepresentationsForToolGroup(
|
||||
toolGroupId
|
||||
);
|
||||
const segmentationRepresentations =
|
||||
this.getSegmentationRepresentationsForToolGroup(toolGroupId);
|
||||
|
||||
if (segmentationRepresentations.length === 0) {
|
||||
return;
|
||||
@@ -1974,21 +1788,13 @@ class SegmentationService extends PubSubService {
|
||||
return;
|
||||
}
|
||||
|
||||
const segmentationState = cstSegmentation.state.getSegmentation(
|
||||
segmentationId
|
||||
);
|
||||
const segmentationState = cstSegmentation.state.getSegmentation(segmentationId);
|
||||
|
||||
if (!segmentationState) {
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
activeSegmentIndex,
|
||||
cachedStats,
|
||||
segmentsLocked,
|
||||
label,
|
||||
type,
|
||||
} = segmentationState;
|
||||
const { activeSegmentIndex, cachedStats, segmentsLocked, label, type } = segmentationState;
|
||||
|
||||
if (![LABELMAP, CONTOUR].includes(type)) {
|
||||
throw new Error(
|
||||
@@ -2018,10 +1824,7 @@ class SegmentationService extends PubSubService {
|
||||
try {
|
||||
this.addOrUpdateSegmentation(segmentationSchema);
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
`Failed to add/update segmentation ${segmentationId}`,
|
||||
error
|
||||
);
|
||||
console.warn(`Failed to add/update segmentation ${segmentationId}`, error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2037,9 +1840,7 @@ class SegmentationService extends PubSubService {
|
||||
);
|
||||
|
||||
if (!segmentationRepresentation) {
|
||||
throw new Error(
|
||||
'Must add representation to toolgroup before setting segments'
|
||||
);
|
||||
throw new Error('Must add representation to toolgroup before setting segments');
|
||||
}
|
||||
|
||||
const { segmentationRepresentationUID } = segmentationRepresentation;
|
||||
@@ -2057,14 +1858,11 @@ class SegmentationService extends PubSubService {
|
||||
return;
|
||||
}
|
||||
|
||||
const toolGroupIds = segmentationState.getToolGroupIdsWithSegmentation(
|
||||
segmentationId
|
||||
);
|
||||
const toolGroupIds = segmentationState.getToolGroupIdsWithSegmentation(segmentationId);
|
||||
|
||||
toolGroupIds.forEach(toolGroupId => {
|
||||
const segmentationRepresentations = segmentationState.getSegmentationRepresentations(
|
||||
toolGroupId
|
||||
);
|
||||
const segmentationRepresentations =
|
||||
segmentationState.getSegmentationRepresentations(toolGroupId);
|
||||
|
||||
const UIDsToRemove = [];
|
||||
segmentationRepresentations.forEach(representation => {
|
||||
@@ -2089,17 +1887,12 @@ class SegmentationService extends PubSubService {
|
||||
}
|
||||
}
|
||||
|
||||
private _updateCornerstoneSegmentations({
|
||||
segmentationId,
|
||||
notYetUpdatedAtSource,
|
||||
}) {
|
||||
private _updateCornerstoneSegmentations({ segmentationId, notYetUpdatedAtSource }) {
|
||||
if (notYetUpdatedAtSource === false) {
|
||||
return;
|
||||
}
|
||||
const segmentationState = cstSegmentation.state;
|
||||
const sourceSegmentation = segmentationState.getSegmentation(
|
||||
segmentationId
|
||||
);
|
||||
const sourceSegmentation = segmentationState.getSegmentation(segmentationId);
|
||||
const segmentation = this.segmentations[segmentationId];
|
||||
const { label, cachedStats } = segmentation;
|
||||
|
||||
@@ -2115,14 +1908,11 @@ class SegmentationService extends PubSubService {
|
||||
|
||||
private _updateCornerstoneSegmentationVisibility = segmentationId => {
|
||||
const segmentationState = cstSegmentation.state;
|
||||
const toolGroupIds = segmentationState.getToolGroupIdsWithSegmentation(
|
||||
segmentationId
|
||||
);
|
||||
const toolGroupIds = segmentationState.getToolGroupIdsWithSegmentation(segmentationId);
|
||||
|
||||
toolGroupIds.forEach(toolGroupId => {
|
||||
const segmentationRepresentations = cstSegmentation.state.getSegmentationRepresentations(
|
||||
toolGroupId
|
||||
);
|
||||
const segmentationRepresentations =
|
||||
cstSegmentation.state.getSegmentationRepresentations(toolGroupId);
|
||||
|
||||
if (segmentationRepresentations.length === 0) {
|
||||
return;
|
||||
@@ -2146,10 +1936,7 @@ class SegmentationService extends PubSubService {
|
||||
);
|
||||
|
||||
// update segments visibility
|
||||
const { segmentation } = this._getSegmentationInfo(
|
||||
segmentationId,
|
||||
toolGroupId
|
||||
);
|
||||
const { segmentation } = this._getSegmentationInfo(segmentationId, toolGroupId);
|
||||
|
||||
const segments = segmentation.segments.filter(Boolean);
|
||||
|
||||
@@ -2161,9 +1948,7 @@ class SegmentationService extends PubSubService {
|
||||
|
||||
private _getToolGroupIdsWithSegmentation(segmentationId: string) {
|
||||
const segmentationState = cstSegmentation.state;
|
||||
const toolGroupIds = segmentationState.getToolGroupIdsWithSegmentation(
|
||||
segmentationId
|
||||
);
|
||||
const toolGroupIds = segmentationState.getToolGroupIdsWithSegmentation(segmentationId);
|
||||
|
||||
return toolGroupIds;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
synchronizers,
|
||||
SynchronizerManager,
|
||||
Synchronizer,
|
||||
} from '@cornerstonejs/tools';
|
||||
import { synchronizers, SynchronizerManager, Synchronizer } from '@cornerstonejs/tools';
|
||||
|
||||
import { pubSubServiceInterface, Types, ServicesManager } from '@ohif/core';
|
||||
|
||||
@@ -14,10 +10,7 @@ const EVENTS = {
|
||||
* @params options - are an optional set of options associated with the first
|
||||
* sync group declared.
|
||||
*/
|
||||
export type SyncCreator = (
|
||||
id: string,
|
||||
options?: Record<string, unknown>
|
||||
) => Synchronizer;
|
||||
export type SyncCreator = (id: string, options?: Record<string, unknown>) => Synchronizer;
|
||||
|
||||
export type SyncGroup = {
|
||||
type: string;
|
||||
@@ -40,9 +33,7 @@ export default class SyncGroupService {
|
||||
static REGISTRATION = {
|
||||
name: 'syncGroupService',
|
||||
altName: 'SyncGroupService',
|
||||
create: ({
|
||||
servicesManager,
|
||||
}: Types.Extensions.ExtensionParams): SyncGroupService => {
|
||||
create: ({ servicesManager }: Types.Extensions.ExtensionParams): SyncGroupService => {
|
||||
return new SyncGroupService(servicesManager);
|
||||
},
|
||||
};
|
||||
@@ -65,11 +56,7 @@ export default class SyncGroupService {
|
||||
Object.assign(this, pubSubServiceInterface);
|
||||
}
|
||||
|
||||
private _createSynchronizer(
|
||||
type: string,
|
||||
id: string,
|
||||
options
|
||||
): Synchronizer | undefined {
|
||||
private _createSynchronizer(type: string, id: string, options): Synchronizer | undefined {
|
||||
const syncCreator = this.synchronizerCreators[type.toLowerCase()];
|
||||
if (syncCreator) {
|
||||
return syncCreator(id, options);
|
||||
@@ -109,19 +96,11 @@ export default class SyncGroupService {
|
||||
return;
|
||||
}
|
||||
|
||||
const syncGroupsArray = Array.isArray(syncGroups)
|
||||
? syncGroups
|
||||
: [syncGroups];
|
||||
const syncGroupsArray = Array.isArray(syncGroups) ? syncGroups : [syncGroups];
|
||||
|
||||
syncGroupsArray.forEach(syncGroup => {
|
||||
const syncGroupObj = asSyncGroup(syncGroup);
|
||||
const {
|
||||
type,
|
||||
target = true,
|
||||
source = true,
|
||||
options = {},
|
||||
id = type,
|
||||
} = syncGroupObj;
|
||||
const { type, target = true, source = true, options = {}, id = type } = syncGroupObj;
|
||||
|
||||
const synchronizer = this._getOrCreateSynchronizer(type, id, options);
|
||||
synchronizer.setOptions(viewportId, options);
|
||||
|
||||
@@ -24,9 +24,7 @@ export default class ToolGroupService {
|
||||
public static REGISTRATION = {
|
||||
name: 'toolGroupService',
|
||||
altName: 'ToolGroupService',
|
||||
create: ({
|
||||
servicesManager,
|
||||
}: OhifTypes.Extensions.ExtensionParams): ToolGroupService => {
|
||||
create: ({ servicesManager }: OhifTypes.Extensions.ExtensionParams): ToolGroupService => {
|
||||
return new ToolGroupService(servicesManager);
|
||||
},
|
||||
};
|
||||
@@ -40,10 +38,7 @@ export default class ToolGroupService {
|
||||
EVENTS: { [key: string]: string };
|
||||
|
||||
constructor(serviceManager) {
|
||||
const {
|
||||
cornerstoneViewportService,
|
||||
viewportGridService,
|
||||
} = serviceManager.services;
|
||||
const { cornerstoneViewportService, viewportGridService } = serviceManager.services;
|
||||
this.cornerstoneViewportService = cornerstoneViewportService;
|
||||
this.viewportGridService = viewportGridService;
|
||||
this.listeners = {};
|
||||
@@ -66,19 +61,14 @@ export default class ToolGroupService {
|
||||
|
||||
if (!toolGroupIdToUse) {
|
||||
// Use the active viewport's tool group if no tool group id is provided
|
||||
const enabledElement = getActiveViewportEnabledElement(
|
||||
this.viewportGridService
|
||||
);
|
||||
const enabledElement = getActiveViewportEnabledElement(this.viewportGridService);
|
||||
|
||||
if (!enabledElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { renderingEngineId, viewportId } = enabledElement;
|
||||
const toolGroup = ToolGroupManager.getToolGroupForViewport(
|
||||
viewportId,
|
||||
renderingEngineId
|
||||
);
|
||||
const toolGroup = ToolGroupManager.getToolGroupForViewport(viewportId, renderingEngineId);
|
||||
|
||||
if (!toolGroup) {
|
||||
console.warn(
|
||||
@@ -103,10 +93,7 @@ export default class ToolGroupService {
|
||||
|
||||
public getToolGroupForViewport(viewportId: string): Types.IToolGroup | void {
|
||||
const renderingEngine = this.cornerstoneViewportService.getRenderingEngine();
|
||||
return ToolGroupManager.getToolGroupForViewport(
|
||||
viewportId,
|
||||
renderingEngine.id
|
||||
);
|
||||
return ToolGroupManager.getToolGroupForViewport(viewportId, renderingEngine.id);
|
||||
}
|
||||
|
||||
public getActiveToolForViewport(viewportId: string): string {
|
||||
@@ -133,10 +120,7 @@ export default class ToolGroupService {
|
||||
renderingEngineId: string,
|
||||
deleteToolGroupIfEmpty?: boolean
|
||||
): void {
|
||||
const toolGroup = ToolGroupManager.getToolGroupForViewport(
|
||||
viewportId,
|
||||
renderingEngineId
|
||||
);
|
||||
const toolGroup = ToolGroupManager.getToolGroupForViewport(viewportId, renderingEngineId);
|
||||
|
||||
if (!toolGroup) {
|
||||
return;
|
||||
@@ -193,11 +177,7 @@ export default class ToolGroupService {
|
||||
return toolGroup;
|
||||
}
|
||||
|
||||
public addToolsToToolGroup(
|
||||
toolGroupId: string,
|
||||
tools: Array<Tool>,
|
||||
configs: any = {}
|
||||
): void {
|
||||
public addToolsToToolGroup(toolGroupId: string, tools: Array<Tool>, configs: any = {}): void {
|
||||
const toolGroup = ToolGroupManager.getToolGroup(toolGroupId);
|
||||
// this.changeConfigurationIfNecessary(toolGroup, volumeId);
|
||||
this._addTools(toolGroup, tools, configs);
|
||||
|
||||
+31
-110
@@ -12,10 +12,7 @@ import {
|
||||
Enums as csEnums,
|
||||
} from '@cornerstonejs/core';
|
||||
|
||||
import {
|
||||
utilities as csToolsUtils,
|
||||
Enums as csToolsEnums,
|
||||
} from '@cornerstonejs/tools';
|
||||
import { utilities as csToolsUtils, Enums as csToolsEnums } from '@cornerstonejs/tools';
|
||||
import { IViewportService } from './IViewportService';
|
||||
import { RENDERING_ENGINE_ID } from './constants';
|
||||
import ViewportInfo, {
|
||||
@@ -23,25 +20,20 @@ import ViewportInfo, {
|
||||
DisplaySetOptions,
|
||||
PublicViewportOptions,
|
||||
} from './Viewport';
|
||||
import {
|
||||
StackViewportData,
|
||||
VolumeViewportData,
|
||||
} from '../../types/CornerstoneCacheService';
|
||||
import { StackViewportData, VolumeViewportData } from '../../types/CornerstoneCacheService';
|
||||
import { Presentation, Presentations } from '../../types/Presentation';
|
||||
|
||||
import JumpPresets from '../../utils/JumpPresets';
|
||||
|
||||
const EVENTS = {
|
||||
VIEWPORT_DATA_CHANGED:
|
||||
'event::cornerstoneViewportService:viewportDataChanged',
|
||||
VIEWPORT_DATA_CHANGED: 'event::cornerstoneViewportService:viewportDataChanged',
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles cornerstone viewport logic including enabling, disabling, and
|
||||
* updating the viewport.
|
||||
*/
|
||||
class CornerstoneViewportService extends PubSubService
|
||||
implements IViewportService {
|
||||
class CornerstoneViewportService extends PubSubService implements IViewportService {
|
||||
static REGISTRATION = {
|
||||
name: 'cornerstoneViewportService',
|
||||
altName: 'CornerstoneViewportService',
|
||||
@@ -182,8 +174,7 @@ class CornerstoneViewportService extends PubSubService
|
||||
const camera = csViewport.getCamera();
|
||||
return {
|
||||
presentationIds,
|
||||
viewportType:
|
||||
!viewportType || viewportType === 'stack' ? 'stack' : 'volume',
|
||||
viewportType: !viewportType || viewportType === 'stack' ? 'stack' : 'volume',
|
||||
properties,
|
||||
initialImageIndex,
|
||||
camera,
|
||||
@@ -202,10 +193,7 @@ class CornerstoneViewportService extends PubSubService
|
||||
if (!presentation || !presentation.presentationIds) {
|
||||
return;
|
||||
}
|
||||
const {
|
||||
lutPresentationStore,
|
||||
positionPresentationStore,
|
||||
} = stateSyncService.getState();
|
||||
const { lutPresentationStore, positionPresentationStore } = stateSyncService.getState();
|
||||
const { presentationIds } = presentation;
|
||||
const { lutPresentationId, positionPresentationId } = presentationIds || {};
|
||||
const storeState = {};
|
||||
@@ -258,12 +246,8 @@ class CornerstoneViewportService extends PubSubService
|
||||
|
||||
// override the viewportOptions and displaySetOptions with the public ones
|
||||
// since those are the newly set ones, we set them here so that it handles defaults
|
||||
const displaySetOptions = viewportInfo.setPublicDisplaySetOptions(
|
||||
publicDisplaySetOptions
|
||||
);
|
||||
const viewportOptions = viewportInfo.setPublicViewportOptions(
|
||||
publicViewportOptions
|
||||
);
|
||||
const displaySetOptions = viewportInfo.setPublicDisplaySetOptions(publicDisplaySetOptions);
|
||||
const viewportOptions = viewportInfo.setPublicViewportOptions(publicViewportOptions);
|
||||
|
||||
const element = viewportInfo.getElement();
|
||||
const type = viewportInfo.getViewportType();
|
||||
@@ -317,11 +301,7 @@ class CornerstoneViewportService extends PubSubService
|
||||
): Types.IStackViewport | Types.IVolumeViewport | null {
|
||||
const viewportInfo = this.getViewportInfo(viewportId);
|
||||
|
||||
if (
|
||||
!viewportInfo ||
|
||||
!this.renderingEngine ||
|
||||
this.renderingEngine.hasBeenDestroyed
|
||||
) {
|
||||
if (!viewportInfo || !this.renderingEngine || this.renderingEngine.hasBeenDestroyed) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -342,24 +322,15 @@ class CornerstoneViewportService extends PubSubService
|
||||
): void {
|
||||
const displaySetOptions = viewportInfo.getDisplaySetOptions();
|
||||
|
||||
const {
|
||||
imageIds,
|
||||
initialImageIndex,
|
||||
displaySetInstanceUID,
|
||||
} = viewportData.data;
|
||||
const { imageIds, initialImageIndex, displaySetInstanceUID } = viewportData.data;
|
||||
|
||||
this.viewportsDisplaySets.set(viewport.id, [displaySetInstanceUID]);
|
||||
|
||||
let initialImageIndexToUse =
|
||||
presentations?.positionPresentation?.initialImageIndex ??
|
||||
initialImageIndex;
|
||||
presentations?.positionPresentation?.initialImageIndex ?? initialImageIndex;
|
||||
|
||||
if (
|
||||
initialImageIndexToUse === undefined ||
|
||||
initialImageIndexToUse === null
|
||||
) {
|
||||
initialImageIndexToUse =
|
||||
this._getInitialImageIndexForViewport(viewportInfo, imageIds) || 0;
|
||||
if (initialImageIndexToUse === undefined || initialImageIndexToUse === null) {
|
||||
initialImageIndexToUse = this._getInitialImageIndexForViewport(viewportInfo, imageIds) || 0;
|
||||
}
|
||||
|
||||
const properties = { ...presentations.lutPresentation?.properties };
|
||||
@@ -404,12 +375,8 @@ class CornerstoneViewportService extends PubSubService
|
||||
if (viewportType === csEnums.ViewportType.STACK) {
|
||||
numberOfSlices = imageIds.length;
|
||||
} else if (viewportType === csEnums.ViewportType.ORTHOGRAPHIC) {
|
||||
const viewport = this.getCornerstoneViewport(
|
||||
viewportInfo.getViewportId()
|
||||
);
|
||||
const imageSliceData = csUtils.getImageSliceDataForVolumeViewport(
|
||||
viewport
|
||||
);
|
||||
const viewport = this.getCornerstoneViewport(viewportInfo.getViewportId());
|
||||
const imageSliceData = csUtils.getImageSliceDataForVolumeViewport(viewport);
|
||||
|
||||
if (!imageSliceData) {
|
||||
return;
|
||||
@@ -423,11 +390,7 @@ class CornerstoneViewportService extends PubSubService
|
||||
return this._getInitialImageIndex(numberOfSlices, index, preset);
|
||||
}
|
||||
|
||||
_getInitialImageIndex(
|
||||
numberOfSlices: number,
|
||||
imageIndex?: number,
|
||||
preset?: JumpPresets
|
||||
): number {
|
||||
_getInitialImageIndex(numberOfSlices: number, imageIndex?: number, preset?: JumpPresets): number {
|
||||
const lastSliceIndex = numberOfSlices - 1;
|
||||
|
||||
if (imageIndex !== undefined) {
|
||||
@@ -449,9 +412,7 @@ class CornerstoneViewportService extends PubSubService
|
||||
// it will jump to a different slice than the middle one which
|
||||
// was the initial slice, and we have some tools such as Crosshairs
|
||||
// which rely on a relative camera modifications and those will break.
|
||||
return lastSliceIndex % 2 === 0
|
||||
? lastSliceIndex / 2
|
||||
: (lastSliceIndex + 1) / 2;
|
||||
return lastSliceIndex % 2 === 0 ? lastSliceIndex / 2 : (lastSliceIndex + 1) / 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -521,22 +482,11 @@ class CornerstoneViewportService extends PubSubService
|
||||
});
|
||||
|
||||
// This returns the async continuation only
|
||||
return this.setVolumesForViewport(
|
||||
viewport,
|
||||
volumeInputArray,
|
||||
presentations
|
||||
);
|
||||
return this.setVolumesForViewport(viewport, volumeInputArray, presentations);
|
||||
}
|
||||
|
||||
public async setVolumesForViewport(
|
||||
viewport,
|
||||
volumeInputArray,
|
||||
presentations
|
||||
) {
|
||||
const {
|
||||
displaySetService,
|
||||
toolGroupService,
|
||||
} = this.servicesManager.services;
|
||||
public async setVolumesForViewport(viewport, volumeInputArray, presentations) {
|
||||
const { displaySetService, toolGroupService } = this.servicesManager.services;
|
||||
|
||||
const viewportInfo = this.getViewportInfo(viewport.id);
|
||||
const displaySetOptions = viewportInfo.getDisplaySetOptions();
|
||||
@@ -594,10 +544,7 @@ class CornerstoneViewportService extends PubSubService
|
||||
// associated with the primary displaySet
|
||||
|
||||
// get segmentations only returns the hydrated segmentations
|
||||
this._addSegmentationRepresentationToToolGroupIfNecessary(
|
||||
displaySetInstanceUIDs,
|
||||
viewport
|
||||
);
|
||||
this._addSegmentationRepresentationToToolGroupIfNecessary(displaySetInstanceUIDs, viewport);
|
||||
}
|
||||
|
||||
const toolGroup = toolGroupService.getToolGroupForViewport(viewport.id);
|
||||
@@ -618,10 +565,7 @@ class CornerstoneViewportService extends PubSubService
|
||||
displaySetInstanceUIDs: string[],
|
||||
viewport: any
|
||||
) {
|
||||
const {
|
||||
segmentationService,
|
||||
toolGroupService,
|
||||
} = this.servicesManager.services;
|
||||
const { segmentationService, toolGroupService } = this.servicesManager.services;
|
||||
|
||||
const toolGroup = toolGroupService.getToolGroupForViewport(viewport.id);
|
||||
|
||||
@@ -630,9 +574,7 @@ class CornerstoneViewportService extends PubSubService
|
||||
|
||||
for (const segmentation of segmentations) {
|
||||
const toolGroupSegmentationRepresentations =
|
||||
segmentationService.getSegmentationRepresentationsForToolGroup(
|
||||
toolGroup.id
|
||||
) || [];
|
||||
segmentationService.getSegmentationRepresentationsForToolGroup(toolGroup.id) || [];
|
||||
|
||||
// if there is already a segmentation representation for this segmentation
|
||||
// for this toolGroup, don't bother at all
|
||||
@@ -647,16 +589,12 @@ class CornerstoneViewportService extends PubSubService
|
||||
// otherwise, check if the hydrated segmentations are in the same FOR
|
||||
// as the primary displaySet, if so add the representation (since it was not there)
|
||||
const { id: segDisplaySetInstanceUID, type } = segmentation;
|
||||
const segFrameOfReferenceUID = this._getFrameOfReferenceUID(
|
||||
segDisplaySetInstanceUID
|
||||
);
|
||||
const segFrameOfReferenceUID = this._getFrameOfReferenceUID(segDisplaySetInstanceUID);
|
||||
|
||||
let shouldDisplaySeg = false;
|
||||
|
||||
for (const displaySetInstanceUID of displaySetInstanceUIDs) {
|
||||
const primaryFrameOfReferenceUID = this._getFrameOfReferenceUID(
|
||||
displaySetInstanceUID
|
||||
);
|
||||
const primaryFrameOfReferenceUID = this._getFrameOfReferenceUID(displaySetInstanceUID);
|
||||
|
||||
if (segFrameOfReferenceUID === primaryFrameOfReferenceUID) {
|
||||
shouldDisplaySeg = true;
|
||||
@@ -677,14 +615,8 @@ class CornerstoneViewportService extends PubSubService
|
||||
}
|
||||
}
|
||||
|
||||
private addOverlayRepresentationForDisplaySet(
|
||||
displaySet: any,
|
||||
viewport: any
|
||||
) {
|
||||
const {
|
||||
segmentationService,
|
||||
toolGroupService,
|
||||
} = this.servicesManager.services;
|
||||
private addOverlayRepresentationForDisplaySet(displaySet: any, viewport: any) {
|
||||
const { segmentationService, toolGroupService } = this.servicesManager.services;
|
||||
|
||||
const { referencedVolumeId } = displaySet;
|
||||
const segmentationId = displaySet.displaySetInstanceUID;
|
||||
@@ -711,10 +643,7 @@ class CornerstoneViewportService extends PubSubService
|
||||
const viewport = this.getCornerstoneViewport(viewportId);
|
||||
const viewportCamera = viewport.getCamera();
|
||||
|
||||
if (
|
||||
viewport instanceof VolumeViewport ||
|
||||
viewport instanceof VolumeViewport3D
|
||||
) {
|
||||
if (viewport instanceof VolumeViewport || viewport instanceof VolumeViewport3D) {
|
||||
this._setVolumeViewport(viewport, viewportData, viewportInfo).then(() => {
|
||||
if (keepCamera) {
|
||||
viewport.setCamera(viewportCamera);
|
||||
@@ -744,10 +673,7 @@ class CornerstoneViewportService extends PubSubService
|
||||
viewportInfo,
|
||||
presentations
|
||||
);
|
||||
} else if (
|
||||
viewport instanceof VolumeViewport ||
|
||||
viewport instanceof VolumeViewport3D
|
||||
) {
|
||||
} else if (viewport instanceof VolumeViewport || viewport instanceof VolumeViewport3D) {
|
||||
this._setVolumeViewport(
|
||||
viewport,
|
||||
viewportData as VolumeViewportData,
|
||||
@@ -770,10 +696,7 @@ class CornerstoneViewportService extends PubSubService
|
||||
|
||||
_getSlabThickness(displaySetOptions, volumeId) {
|
||||
const { blendMode } = displaySetOptions;
|
||||
if (
|
||||
blendMode === undefined ||
|
||||
displaySetOptions.slabThickness === undefined
|
||||
) {
|
||||
if (blendMode === undefined || displaySetOptions.slabThickness === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -799,9 +722,7 @@ class CornerstoneViewportService extends PubSubService
|
||||
|
||||
_getFrameOfReferenceUID(displaySetInstanceUID) {
|
||||
const { displaySetService } = this.servicesManager.services;
|
||||
const displaySet = displaySetService.getDisplaySetByUID(
|
||||
displaySetInstanceUID
|
||||
);
|
||||
const displaySet = displaySetService.getDisplaySetByUID(displaySetInstanceUID);
|
||||
|
||||
if (!displaySet) {
|
||||
return;
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import { Types } from '@cornerstonejs/core';
|
||||
import { StackData, VolumeData } from '../../types/CornerstoneCacheService';
|
||||
import {
|
||||
DisplaySetOptions,
|
||||
PublicViewportOptions,
|
||||
ViewportOptions,
|
||||
} from './Viewport';
|
||||
import { DisplaySetOptions, PublicViewportOptions, ViewportOptions } from './Viewport';
|
||||
|
||||
/**
|
||||
* Handles cornerstone viewport logic including enabling, disabling, and
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import { Types, Enums } from '@cornerstonejs/core';
|
||||
import { Types as UITypes } from '@ohif/ui';
|
||||
import {
|
||||
StackViewportData,
|
||||
VolumeViewportData,
|
||||
} from '../../types/CornerstoneCacheService';
|
||||
import { StackViewportData, VolumeViewportData } from '../../types/CornerstoneCacheService';
|
||||
import getCornerstoneBlendMode from '../../utils/getCornerstoneBlendMode';
|
||||
import getCornerstoneOrientation from '../../utils/getCornerstoneOrientation';
|
||||
import getCornerstoneViewportType from '../../utils/getCornerstoneViewportType';
|
||||
@@ -90,11 +87,7 @@ const DEFAULT_TOOLGROUP_ID = 'default';
|
||||
|
||||
// Return true if the data contains the given display set UID OR the imageId
|
||||
// if it is a composite object.
|
||||
const dataContains = (
|
||||
data,
|
||||
displaySetUID: string,
|
||||
imageId?: string
|
||||
): boolean => {
|
||||
const dataContains = (data, displaySetUID: string, imageId?: string): boolean => {
|
||||
if (data.displaySetInstanceUID === displaySetUID) {
|
||||
return true;
|
||||
}
|
||||
@@ -128,9 +121,7 @@ class ViewportInfo {
|
||||
}
|
||||
|
||||
if (this.viewportData.data.length) {
|
||||
return !!this.viewportData.data.find(data =>
|
||||
dataContains(data, displaySetUID, imageId)
|
||||
);
|
||||
return !!this.viewportData.data.find(data => dataContains(data, displaySetUID, imageId));
|
||||
}
|
||||
return dataContains(this.viewportData.data, displaySetUID, imageId);
|
||||
}
|
||||
@@ -158,9 +149,7 @@ class ViewportInfo {
|
||||
this.element = element;
|
||||
}
|
||||
|
||||
public setViewportData(
|
||||
viewportData: StackViewportData | VolumeViewportData
|
||||
): void {
|
||||
public setViewportData(viewportData: StackViewportData | VolumeViewportData): void {
|
||||
this.viewportData = viewportData;
|
||||
}
|
||||
|
||||
@@ -168,7 +157,6 @@ class ViewportInfo {
|
||||
return this.viewportData;
|
||||
}
|
||||
|
||||
|
||||
public getElement(): HTMLDivElement {
|
||||
return this.element;
|
||||
}
|
||||
@@ -181,13 +169,11 @@ class ViewportInfo {
|
||||
publicDisplaySetOptions: PublicDisplaySetOptions[] | DisplaySetSelector[]
|
||||
): Array<DisplaySetOptions> {
|
||||
// map the displaySetOptions and check if they are undefined then set them to default values
|
||||
const displaySetOptions = this.mapDisplaySetOptions(
|
||||
publicDisplaySetOptions
|
||||
);
|
||||
const displaySetOptions = this.mapDisplaySetOptions(publicDisplaySetOptions);
|
||||
|
||||
this.setDisplaySetOptions(displaySetOptions);
|
||||
|
||||
return this.displaySetOptions
|
||||
return this.displaySetOptions;
|
||||
}
|
||||
|
||||
public hasDisplaySet(displaySetInstanceUID: string): boolean {
|
||||
@@ -196,8 +182,9 @@ class ViewportInfo {
|
||||
// via cornerstoneViewportService
|
||||
let viewportData = this.getViewportData();
|
||||
|
||||
if (viewportData.viewportType === Enums.ViewportType.ORTHOGRAPHIC ||
|
||||
viewportData.viewportType === Enums.ViewportType.VOLUME_3D
|
||||
if (
|
||||
viewportData.viewportType === Enums.ViewportType.ORTHOGRAPHIC ||
|
||||
viewportData.viewportType === Enums.ViewportType.VOLUME_3D
|
||||
) {
|
||||
viewportData = viewportData as VolumeViewportData;
|
||||
return viewportData.data.some(
|
||||
@@ -209,22 +196,15 @@ class ViewportInfo {
|
||||
return viewportData.data.displaySetInstanceUID === displaySetInstanceUID;
|
||||
}
|
||||
|
||||
public setPublicViewportOptions(
|
||||
viewportOptionsEntry: PublicViewportOptions
|
||||
): ViewportOptions {
|
||||
public setPublicViewportOptions(viewportOptionsEntry: PublicViewportOptions): ViewportOptions {
|
||||
let viewportType = viewportOptionsEntry.viewportType;
|
||||
const {
|
||||
toolGroupId = DEFAULT_TOOLGROUP_ID,
|
||||
presentationIds,
|
||||
} = viewportOptionsEntry;
|
||||
const { toolGroupId = DEFAULT_TOOLGROUP_ID, presentationIds } = viewportOptionsEntry;
|
||||
let orientation;
|
||||
|
||||
if (!viewportType) {
|
||||
viewportType = getCornerstoneViewportType(STACK);
|
||||
} else {
|
||||
viewportType = getCornerstoneViewportType(
|
||||
viewportOptionsEntry.viewportType
|
||||
);
|
||||
viewportType = getCornerstoneViewportType(viewportOptionsEntry.viewportType);
|
||||
}
|
||||
|
||||
// map SAGITTAL, AXIAL, CORONAL orientation to be used by cornerstone
|
||||
@@ -256,9 +236,7 @@ class ViewportInfo {
|
||||
return this.viewportOptions;
|
||||
}
|
||||
|
||||
public setDisplaySetOptions(
|
||||
displaySetOptions: Array<DisplaySetOptions>
|
||||
): void {
|
||||
public setDisplaySetOptions(displaySetOptions: Array<DisplaySetOptions>): void {
|
||||
this.displaySetOptions = displaySetOptions;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user