Skip to content

Commit

Permalink
fix: Disable viewport indicators in CrosshairsTool by default (#1296)
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi authored May 30, 2024
1 parent f35943f commit dbf3e88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
24 changes: 2 additions & 22 deletions packages/tools/src/tools/CrosshairsTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,6 @@ import { CONSTANTS } from '@cornerstonejs/core';

const { RENDERING_DEFAULTS } = CONSTANTS;

// TODO: nested config is weird
interface ToolConfiguration {
configuration?: {
getReferenceLineColor?: (viewportId: string) => string;
getReferenceLineControllable?: (viewportId: string) => boolean;
getReferenceLineDraggableRotatable?: (viewportId: string) => boolean;
getReferenceLineSlabThicknessControlsOn?: (viewportId: string) => boolean;
referenceLinesCenterGapRadius?: number;
shadow?: boolean;
autopan?: {
enabled: boolean;
panSize: number;
};
mobile?: {
enabled: boolean;
opacity: number;
handleRadius: number;
};
};
}

interface CrosshairsAnnotation extends Annotation {
data: {
handles: {
Expand Down Expand Up @@ -142,7 +121,7 @@ class CrosshairsTool extends AnnotationTool {
shadow: true,
// renders a colored circle on top right of the viewports whose color
// matches the color of the reference line
viewportIndicators: true,
viewportIndicators: false,

viewportIndicatorsConfig: {
radius: 5,
Expand Down Expand Up @@ -1454,6 +1433,7 @@ class CrosshairsTool extends AnnotationTool {
data.handles.rotationPoints = newRtpoints;
data.handles.slabThicknessPoints = newStpoints;

debugger;
if (this.configuration.viewportIndicators) {
const { viewportIndicatorsConfig } = this.configuration;

Expand Down
2 changes: 1 addition & 1 deletion packages/tools/src/tools/base/AnnotationTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ abstract class AnnotationTool extends AnnotationDisplayTool {
if (viewport instanceof BaseVolumeViewport) {
const volumeId = csUtils.getVolumeId(targetId);
const volume = cache.getVolume(volumeId);
return volume.scaling?.PT !== undefined;
return volume?.scaling?.PT !== undefined;
}
const scalingModule: Types.ScalingParameters | undefined =
imageId && metaData.get('scalingModule', imageId);
Expand Down

0 comments on commit dbf3e88

Please sign in to comment.