* Add customization URL parameter * fix: Preserve should be customizeable * Update customizations docs * fix: Overlay items on patient name * Add customization test * Fix resolve to absolute path * fix: Warn on no data in load * Remove unused customization stuff * fix: PR comments * Update stored parameters to only use an array for mulitples * Remove requires ohif.* special call out * Remove strict mode * PR comments * Document segmentation examples * Add three examples as requested * PR comments * lock * Remove old customizatoin export * fix: Ordering issues on customization loads * fix: Use correct default for dev builds app config * Fixes for conflicts * chore: restore pnpm-lock.yaml to match master The lockfile diff was incidental peer-descriptor churn and carried no functional dependency change. It tripped the CircleCI security-audit gate (which only runs when pnpm-lock.yaml is in the PR diff), surfacing a pre-existing critical `decompress` transitive vuln that also exists on master. Restoring master's lockfile removes the audit trigger. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(ci): restore json5 lockfile entry; ignore unfixable decompress GHSA The previous commit restored pnpm-lock.yaml from master, which dropped the json5@2.2.3 entry that platform/core legitimately depends on (JSONC parsing for the customization feature). That broke `--frozen-lockfile` install (ERR_PNPM_OUTDATED_LOCKFILE). This restores the correct lockfile. Because the lockfile must change (json5), the CircleCI security-audit gate runs and previously failed on a critical `decompress` <=4.2.1 zip-slip advisory. This is a pre-existing transitive vuln (present on master too) with no published patch — decompress's latest release is 4.2.1, so no version bump/override can resolve it. It reaches the tree only via @itk-wasm/dam, a build/data-asset extraction tool under @cornerstonejs/labelmap-interpolation. Add GHSA-mp2f-45pm-3cg9 to the existing pnpm-workspace.yaml auditConfig ignoreGhsas accepted-risk list, matching how the repo already exempts other build-tooling advisories. `pnpm audit --audit-level high` now passes locally (1 critical ignored, 0 high). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * test(e2e): fix visitStudy URL encoding that broke mpr2 study load The visitStudy rewrite (added for the ?customization= option) built the URL with new URLSearchParams({ StudyInstanceUIDs: studyInstanceUID }), which percent-encodes the value. mpr2.spec.ts embeds an extra param in the UID string ('<uid>&hangingprotocolid=mpr'), so the & and = were encoded and the whole thing collapsed into one invalid StudyInstanceUIDs value -> the study could not be found ('studies are not available'), the viewer never rendered, and the side-panel-header-right click timed out. Restore master's raw concatenation for StudyInstanceUIDs (so embedded params survive as separate query params) while still appending the customization option separately. Only mpr2 embeds & in the UID, matching the single failure. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * PR comments --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
189 lines
5.8 KiB
JavaScript
189 lines
5.8 KiB
JavaScript
import {
|
|
PanTool,
|
|
WindowLevelTool,
|
|
SegmentBidirectionalTool,
|
|
StackScrollTool,
|
|
PlanarRotateTool,
|
|
VolumeRotateTool,
|
|
ZoomTool,
|
|
MIPJumpToClickTool,
|
|
LengthTool,
|
|
RectangleROITool,
|
|
RectangleROIThresholdTool,
|
|
EllipticalROITool,
|
|
CircleROITool,
|
|
BidirectionalTool,
|
|
ArrowAnnotateTool,
|
|
DragProbeTool,
|
|
ProbeTool,
|
|
AngleTool,
|
|
CobbAngleTool,
|
|
MagnifyTool,
|
|
CrosshairsTool,
|
|
RectangleScissorsTool,
|
|
SphereScissorsTool,
|
|
CircleScissorsTool,
|
|
BrushTool,
|
|
PaintFillTool,
|
|
init,
|
|
addTool,
|
|
annotation,
|
|
ReferenceLinesTool,
|
|
TrackballRotateTool,
|
|
AdvancedMagnifyTool,
|
|
UltrasoundDirectionalTool,
|
|
UltrasoundPleuraBLineTool,
|
|
PlanarFreehandROITool,
|
|
PlanarFreehandContourSegmentationTool,
|
|
SplineROITool,
|
|
LivewireContourTool,
|
|
OrientationMarkerTool,
|
|
WindowLevelRegionTool,
|
|
SegmentSelectTool,
|
|
RegionSegmentPlusTool,
|
|
SegmentLabelTool,
|
|
LivewireContourSegmentationTool,
|
|
SculptorTool,
|
|
SplineContourSegmentationTool,
|
|
LabelMapEditWithContourTool,
|
|
} from '@cornerstonejs/tools';
|
|
import { LabelmapSlicePropagationTool, MarkerLabelmapTool } from '@cornerstonejs/ai';
|
|
import * as polySeg from '@cornerstonejs/polymorphic-segmentation';
|
|
|
|
import CalibrationLineTool from './tools/CalibrationLineTool';
|
|
import ImageOverlayViewerTool from './tools/ImageOverlayViewerTool';
|
|
|
|
export default function initCornerstoneTools(configuration = {}) {
|
|
CrosshairsTool.isAnnotation = false;
|
|
LabelmapSlicePropagationTool.isAnnotation = false;
|
|
MarkerLabelmapTool.isAnnotation = false;
|
|
ReferenceLinesTool.isAnnotation = false;
|
|
AdvancedMagnifyTool.isAnnotation = false;
|
|
PlanarFreehandContourSegmentationTool.isAnnotation = false;
|
|
|
|
init({
|
|
addons: {
|
|
polySeg,
|
|
},
|
|
computeWorker: {
|
|
autoTerminateOnIdle: {
|
|
enabled: false,
|
|
},
|
|
},
|
|
});
|
|
addTool(PanTool);
|
|
addTool(SegmentBidirectionalTool);
|
|
addTool(WindowLevelTool);
|
|
addTool(StackScrollTool);
|
|
addTool(PlanarRotateTool);
|
|
addTool(VolumeRotateTool);
|
|
addTool(ZoomTool);
|
|
addTool(ProbeTool);
|
|
addTool(MIPJumpToClickTool);
|
|
addTool(LengthTool);
|
|
addTool(RectangleROITool);
|
|
addTool(RectangleROIThresholdTool);
|
|
addTool(EllipticalROITool);
|
|
addTool(CircleROITool);
|
|
addTool(BidirectionalTool);
|
|
addTool(ArrowAnnotateTool);
|
|
addTool(DragProbeTool);
|
|
addTool(AngleTool);
|
|
addTool(CobbAngleTool);
|
|
addTool(MagnifyTool);
|
|
addTool(CrosshairsTool);
|
|
addTool(RectangleScissorsTool);
|
|
addTool(SphereScissorsTool);
|
|
addTool(CircleScissorsTool);
|
|
addTool(BrushTool);
|
|
addTool(PaintFillTool);
|
|
addTool(ReferenceLinesTool);
|
|
addTool(CalibrationLineTool);
|
|
addTool(TrackballRotateTool);
|
|
addTool(ImageOverlayViewerTool);
|
|
addTool(AdvancedMagnifyTool);
|
|
addTool(UltrasoundDirectionalTool);
|
|
addTool(UltrasoundPleuraBLineTool);
|
|
addTool(PlanarFreehandROITool);
|
|
addTool(SplineROITool);
|
|
addTool(LivewireContourTool);
|
|
addTool(OrientationMarkerTool);
|
|
addTool(WindowLevelRegionTool);
|
|
addTool(PlanarFreehandContourSegmentationTool);
|
|
addTool(SegmentSelectTool);
|
|
addTool(SegmentLabelTool);
|
|
addTool(LabelmapSlicePropagationTool);
|
|
addTool(MarkerLabelmapTool);
|
|
addTool(RegionSegmentPlusTool);
|
|
addTool(LivewireContourSegmentationTool);
|
|
addTool(SculptorTool);
|
|
addTool(SplineContourSegmentationTool);
|
|
addTool(LabelMapEditWithContourTool);
|
|
// Modify annotation tools to use dashed lines on SR
|
|
const annotationStyle = {
|
|
textBoxFontSize: '15px',
|
|
lineWidth: '1.5',
|
|
};
|
|
|
|
const defaultStyles = annotation.config.style.getDefaultToolStyles();
|
|
annotation.config.style.setDefaultToolStyles({
|
|
global: {
|
|
...defaultStyles.global,
|
|
...annotationStyle,
|
|
},
|
|
});
|
|
}
|
|
|
|
const toolNames = {
|
|
Pan: PanTool.toolName,
|
|
ArrowAnnotate: ArrowAnnotateTool.toolName,
|
|
WindowLevel: WindowLevelTool.toolName,
|
|
StackScroll: StackScrollTool.toolName,
|
|
Zoom: ZoomTool.toolName,
|
|
PlanarRotate: PlanarRotateTool.toolName,
|
|
VolumeRotate: VolumeRotateTool.toolName,
|
|
MipJumpToClick: MIPJumpToClickTool.toolName,
|
|
Length: LengthTool.toolName,
|
|
DragProbe: DragProbeTool.toolName,
|
|
Probe: ProbeTool.toolName,
|
|
RectangleROI: RectangleROITool.toolName,
|
|
RectangleROIThreshold: RectangleROIThresholdTool.toolName,
|
|
EllipticalROI: EllipticalROITool.toolName,
|
|
CircleROI: CircleROITool.toolName,
|
|
Bidirectional: BidirectionalTool.toolName,
|
|
Angle: AngleTool.toolName,
|
|
CobbAngle: CobbAngleTool.toolName,
|
|
Magnify: MagnifyTool.toolName,
|
|
Crosshairs: CrosshairsTool.toolName,
|
|
Brush: BrushTool.toolName,
|
|
PaintFill: PaintFillTool.toolName,
|
|
ReferenceLines: ReferenceLinesTool.toolName,
|
|
CalibrationLine: CalibrationLineTool.toolName,
|
|
TrackballRotateTool: TrackballRotateTool.toolName,
|
|
CircleScissors: CircleScissorsTool.toolName,
|
|
RectangleScissors: RectangleScissorsTool.toolName,
|
|
SphereScissors: SphereScissorsTool.toolName,
|
|
ImageOverlayViewer: ImageOverlayViewerTool.toolName,
|
|
AdvancedMagnify: AdvancedMagnifyTool.toolName,
|
|
UltrasoundDirectional: UltrasoundDirectionalTool.toolName,
|
|
UltrasoundAnnotation: UltrasoundPleuraBLineTool.toolName,
|
|
SplineROI: SplineROITool.toolName,
|
|
LivewireContour: LivewireContourTool.toolName,
|
|
PlanarFreehandROI: PlanarFreehandROITool.toolName,
|
|
OrientationMarker: OrientationMarkerTool.toolName,
|
|
WindowLevelRegion: WindowLevelRegionTool.toolName,
|
|
PlanarFreehandContourSegmentation: PlanarFreehandContourSegmentationTool.toolName,
|
|
SegmentBidirectional: SegmentBidirectionalTool.toolName,
|
|
SegmentSelect: SegmentSelectTool.toolName,
|
|
SegmentLabel: SegmentLabelTool.toolName,
|
|
LabelmapSlicePropagation: LabelmapSlicePropagationTool.toolName,
|
|
MarkerLabelmap: MarkerLabelmapTool.toolName,
|
|
RegionSegmentPlus: RegionSegmentPlusTool.toolName,
|
|
LivewireContourSegmentation: LivewireContourSegmentationTool.toolName,
|
|
SculptorTool: SculptorTool.toolName,
|
|
SplineContourSegmentation: SplineContourSegmentationTool.toolName,
|
|
LabelMapEditWithContourTool: LabelMapEditWithContourTool.toolName,
|
|
};
|
|
|
|
export { toolNames };
|