copper3d 4.1.4 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +6 -0
  2. package/ai-index/guides/nrrd-tools.md +55 -0
  3. package/ai-index/guides/segmentation-module.md +31 -0
  4. package/ai-index/manifest.json +5 -5
  5. package/ai-index/symbols.json +1 -1
  6. package/dist/Utils/segmentation/DrawToolCore.d.ts +7 -0
  7. package/dist/Utils/segmentation/DrawToolCore.js +42 -8
  8. package/dist/Utils/segmentation/DrawToolCore.js.map +1 -1
  9. package/dist/Utils/segmentation/NrrdTools.d.ts +12 -0
  10. package/dist/Utils/segmentation/NrrdTools.js +58 -0
  11. package/dist/Utils/segmentation/NrrdTools.js.map +1 -1
  12. package/dist/Utils/segmentation/RenderingUtils.d.ts +3 -0
  13. package/dist/Utils/segmentation/RenderingUtils.js +20 -4
  14. package/dist/Utils/segmentation/RenderingUtils.js.map +1 -1
  15. package/dist/Utils/segmentation/core/types.d.ts +9 -0
  16. package/dist/Utils/segmentation/core/types.js.map +1 -1
  17. package/dist/Utils/segmentation/coreTools/GuiState.d.ts +4 -2
  18. package/dist/Utils/segmentation/coreTools/GuiState.js +3 -1
  19. package/dist/Utils/segmentation/coreTools/GuiState.js.map +1 -1
  20. package/dist/Utils/segmentation/tools/DragSliceTool.js +6 -1
  21. package/dist/Utils/segmentation/tools/DragSliceTool.js.map +1 -1
  22. package/dist/Utils/segmentation/tools/DrawingTool.js +9 -1
  23. package/dist/Utils/segmentation/tools/DrawingTool.js.map +1 -1
  24. package/dist/Utils/segmentation/tools/HeatmapOverlay.d.ts +37 -0
  25. package/dist/Utils/segmentation/tools/HeatmapOverlay.js +185 -0
  26. package/dist/Utils/segmentation/tools/HeatmapOverlay.js.map +1 -0
  27. package/dist/Utils/segmentation/tools/SliceRenderPipeline.js +6 -0
  28. package/dist/Utils/segmentation/tools/SliceRenderPipeline.js.map +1 -1
  29. package/dist/Utils/segmentation/tools/SphereTool.js +6 -0
  30. package/dist/Utils/segmentation/tools/SphereTool.js.map +1 -1
  31. package/dist/bundle.esm.mjs +511 -200
  32. package/dist/bundle.umd.js +512 -199
  33. package/dist/index.d.ts +2 -1
  34. package/dist/index.js +2 -1
  35. package/dist/index.js.map +1 -1
  36. package/dist/types/Utils/segmentation/DrawToolCore.d.ts +7 -0
  37. package/dist/types/Utils/segmentation/NrrdTools.d.ts +12 -0
  38. package/dist/types/Utils/segmentation/RenderingUtils.d.ts +3 -0
  39. package/dist/types/Utils/segmentation/core/types.d.ts +9 -0
  40. package/dist/types/Utils/segmentation/coreTools/GuiState.d.ts +4 -2
  41. package/dist/types/Utils/segmentation/tools/HeatmapOverlay.d.ts +37 -0
  42. package/dist/types/index.d.ts +2 -1
  43. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -18,6 +18,7 @@ import { NrrdTools } from "./Utils/segmentation/NrrdTools";
18
18
  import { registerNiftiMaskGrid } from "./Utils/segmentation/tools/DataLoader";
19
19
  import type { NrrdHeaderLike } from "./Utils/segmentation/tools/DataLoader";
20
20
  import { GaussianSmoother } from "./Utils/segmentation/core/GaussianSmoother";
21
+ import { HEATMAP_COLORMAP, heatmapThresholdByte } from "./Utils/segmentation/tools/HeatmapOverlay";
21
22
  import { Copper3dTrackballControls } from "./Controls/Copper3dTrackballControls";
22
23
  import { Copper3dOrbitControls } from "./Controls/Copper3dOrbitControls";
23
24
  import { MeshNodeTool } from "./Utils/MeshNodeTool";
@@ -65,6 +66,6 @@ import { OrientationError, canonicalTransform, geometryFromNrrd, readNrrdOrienta
65
66
  import type { NrrdOrientationFields, OrientationErrorCode, OrientationTransform, ViewAxis, ViewLabels, VolumeGeometry, VolumeOrientation } from "./Utils/orientation";
66
67
  import "./css/style.css";
67
68
  export declare const REVISION: string;
68
- export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, loadKiwrious, NrrdTools, registerNiftiMaskGrid, loading, Copper3dTrackballControls, Copper3dOrbitControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, MAX_ENGINE_CHANNEL, CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, SurfaceAnnotator, exposureExponent, DEFAULT_TARGET_GREY, disposeObject3D, disposeMaterial, collectFadeTargets, setFade, restoreFade, createSceneBudget, defaultBudgetBytes, disposeScene, removeSceneFromMap, fitDistance, fitView, isRotateEnabled, setRotateEnabled, isPanEnabled, setPanEnabled, isZoomEnabled, setZoomEnabled, beginGesture, isGestureActive, setCameraPose, addVolumeBoundingBox, VOLUME_BOUNDS_NAME, rasDimensions, DEFAULT_AXES, ensureAxisExtracted, prepareVolumeSlices, copperGltfLoader, setDracoDecoderPath, setKTX2TranscoderPath, easeInOutCubic, viewPointToPose, rotateAroundAxis, interpolateFlightPose, poseDistance, orbitStepPose, zoomPose, orbitSwingAngle, installFastSliceRepaint, OrientationError, canonicalTransform, geometryFromNrrd, readNrrdOrientationFields, reorientVoxels, reorientedGeometry, viewLabels, };
69
+ export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, loadKiwrious, NrrdTools, registerNiftiMaskGrid, loading, Copper3dTrackballControls, Copper3dOrbitControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, MAX_ENGINE_CHANNEL, CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, HEATMAP_COLORMAP, heatmapThresholdByte, SurfaceAnnotator, exposureExponent, DEFAULT_TARGET_GREY, disposeObject3D, disposeMaterial, collectFadeTargets, setFade, restoreFade, createSceneBudget, defaultBudgetBytes, disposeScene, removeSceneFromMap, fitDistance, fitView, isRotateEnabled, setRotateEnabled, isPanEnabled, setPanEnabled, isZoomEnabled, setZoomEnabled, beginGesture, isGestureActive, setCameraPose, addVolumeBoundingBox, VOLUME_BOUNDS_NAME, rasDimensions, DEFAULT_AXES, ensureAxisExtracted, prepareVolumeSlices, copperGltfLoader, setDracoDecoderPath, setKTX2TranscoderPath, easeInOutCubic, viewPointToPose, rotateAroundAxis, interpolateFlightPose, poseDistance, orbitStepPose, zoomPose, orbitSwingAngle, installFastSliceRepaint, OrientationError, canonicalTransform, geometryFromNrrd, readNrrdOrientationFields, reorientVoxels, reorientedGeometry, viewLabels, };
69
70
  export type { positionType, screenPosType, optsType, NrrdHeaderLike, GltfLoadOpts, nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, IPaintImage, exportPaintImageType, IOptVTKLoader, aligned4DSurfaceType, aligned4DOptsType, Aligned4DController, raw4DVolumeTransformType, raw4DVolumeOptsType, Raw4DVolumeController, ICommXYZ, IGUIStates, IGuiParameterSettings, INrrdStates, NrrdState, GuiState, IGuiMeta, ToolMode, IAnnotationCallbacks, IMaskHistoryChange, MaskRenderMode, LayerId, ChannelValue, ChannelClear, AiPromptTool, AiPromptPoint, AiPromptPayload, AiMaskResult, SurfaceAnnotatorOptions, Annotation, AnnotationMode, ExportOptions, ExposureVolume, DisposableObject3D, DisposableMaterial, FadeTarget, FadeableMaterial, SceneBudget, DisposableScene, SceneDisposalHost, FitBounds, FitViewScene, AxisGatedControls, GestureAxes, PosableScene, BoundingBoxHost, VolumeBoundingBoxOpts, NrrdAxis, Pose, NrrdOrientationFields, OrientationErrorCode, OrientationTransform, ViewAxis, ViewLabels, VolumeGeometry, VolumeOrientation, };
70
71
  export type { CameraViewPreset } from "./Controls/orbitFraming";
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ import kiwrious from "./Utils/kiwrious/configKiwrious";
17
17
  import { NrrdTools } from "./Utils/segmentation/NrrdTools";
18
18
  import { registerNiftiMaskGrid } from "./Utils/segmentation/tools/DataLoader";
19
19
  import { GaussianSmoother } from "./Utils/segmentation/core/GaussianSmoother";
20
+ import { HEATMAP_COLORMAP, heatmapThresholdByte } from "./Utils/segmentation/tools/HeatmapOverlay";
20
21
  // Phase 7: Segmentation Module - Unified exports
21
22
  import { Copper3dTrackballControls } from "./Controls/Copper3dTrackballControls";
22
23
  import { Copper3dOrbitControls } from "./Controls/Copper3dOrbitControls";
@@ -71,5 +72,5 @@ if (typeof window !== "undefined") {
71
72
  if (typeof console !== "undefined") {
72
73
  console.log(`%cCopper3D Visualisation %c${REVISION}`, "padding: 3px;color:white; background:#023047", "padding: 3px;color:white; background:#f50a25");
73
74
  }
74
- export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, loadKiwrious, NrrdTools, registerNiftiMaskGrid, loading, Copper3dTrackballControls, Copper3dOrbitControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, MAX_ENGINE_CHANNEL, CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, SurfaceAnnotator, exposureExponent, DEFAULT_TARGET_GREY, disposeObject3D, disposeMaterial, collectFadeTargets, setFade, restoreFade, createSceneBudget, defaultBudgetBytes, disposeScene, removeSceneFromMap, fitDistance, fitView, isRotateEnabled, setRotateEnabled, isPanEnabled, setPanEnabled, isZoomEnabled, setZoomEnabled, beginGesture, isGestureActive, setCameraPose, addVolumeBoundingBox, VOLUME_BOUNDS_NAME, rasDimensions, DEFAULT_AXES, ensureAxisExtracted, prepareVolumeSlices, copperGltfLoader, setDracoDecoderPath, setKTX2TranscoderPath, easeInOutCubic, viewPointToPose, rotateAroundAxis, interpolateFlightPose, poseDistance, orbitStepPose, zoomPose, orbitSwingAngle, installFastSliceRepaint, OrientationError, canonicalTransform, geometryFromNrrd, readNrrdOrientationFields, reorientVoxels, reorientedGeometry, viewLabels, };
75
+ export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, loadKiwrious, NrrdTools, registerNiftiMaskGrid, loading, Copper3dTrackballControls, Copper3dOrbitControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, MAX_ENGINE_CHANNEL, CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, HEATMAP_COLORMAP, heatmapThresholdByte, SurfaceAnnotator, exposureExponent, DEFAULT_TARGET_GREY, disposeObject3D, disposeMaterial, collectFadeTargets, setFade, restoreFade, createSceneBudget, defaultBudgetBytes, disposeScene, removeSceneFromMap, fitDistance, fitView, isRotateEnabled, setRotateEnabled, isPanEnabled, setPanEnabled, isZoomEnabled, setZoomEnabled, beginGesture, isGestureActive, setCameraPose, addVolumeBoundingBox, VOLUME_BOUNDS_NAME, rasDimensions, DEFAULT_AXES, ensureAxisExtracted, prepareVolumeSlices, copperGltfLoader, setDracoDecoderPath, setKTX2TranscoderPath, easeInOutCubic, viewPointToPose, rotateAroundAxis, interpolateFlightPose, poseDistance, orbitStepPose, zoomPose, orbitSwingAngle, installFastSliceRepaint, OrientationError, canonicalTransform, geometryFromNrrd, readNrrdOrientationFields, reorientVoxels, reorientedGeometry, viewLabels, };
75
76
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,eAAe,EAGf,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAY,MAAM,2BAA2B,CAAC;AACnE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EACL,mBAAmB,EACnB,YAAY,GACb,MAAM,iCAAiC,CAAC;AACzC,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAE9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,iDAAiD;AAEjD,OAAO,EAAE,yBAAyB,EAAE,M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L,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,qBAAqB,EACrB,OAAO,EACP,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EACZ,QAAQ,EACR,sBAAsB,EACtB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,OAAO,EACP,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,OAAO,EACP,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,YAAY,EACZ,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,EACd,kBAAkB,EAClB,UAAU,GACX,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,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,SAAS,EACT,qBAAqB,EACrB,OAAO,EACP,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EACZ,QAAQ,EACR,sBAAsB,EACtB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,OAAO,EACP,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,OAAO,EACP,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,YAAY,EACZ,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,EACd,kBAAkB,EAClB,UAAU,GACX,CAAC"}
@@ -70,6 +70,11 @@ export declare class DrawToolCore {
70
70
  private annotationSuspended;
71
71
  setAnnotationSuspended(suspended: boolean): void;
72
72
  isAnnotationSuspended(): boolean;
73
+ /**
74
+ * True while a mask must not be written: annotation is suspended, or the heatmap is
75
+ * shown (it owns the master canvas, and what is on screen is not a mask).
76
+ */
77
+ private writesBlocked;
73
78
  /**
74
79
  * Left/right button press on the drawing canvas.
75
80
  *
@@ -77,6 +82,8 @@ export declare class DrawToolCore {
77
82
  * directly: it is the single point that decides whether an input may modify a mask.
78
83
  */
79
84
  onCanvasPointerDown(e: MouseEvent): void;
85
+ /** Pointer move while a stroke or pan is active; a stroke can only continue where writes are allowed. */
86
+ private onCanvasPointerMove;
80
87
  /**
81
88
  * Left/right button release on the drawing canvas.
82
89
  *
@@ -320,6 +320,18 @@ export declare class NrrdTools {
320
320
  */
321
321
  setMaskRenderMode(mode: MaskRenderMode): void;
322
322
  getMaskRenderMode(): MaskRenderMode;
323
+ /**
324
+ * Canonical uint8 probabilities (p × 255), x fastest, in the loaded image's dimensions.
325
+ * Throws when `dims` differ from the image's or do not match the volume's length. null clears.
326
+ */
327
+ setHeatmap(volume: Uint8Array | null, dims?: [number, number, number]): void;
328
+ /** Show the heatmap instead of every mask layer, or bring the layers back. */
329
+ setHeatmapVisible(visible: boolean): void;
330
+ isHeatmapVisible(): boolean;
331
+ /** Probabilities below `t` (clamped to 0–1) are not drawn. */
332
+ setHeatmapThreshold(t: number): void;
333
+ /** Clamped to 0–1. */
334
+ setHeatmapOpacity(a: number): void;
323
335
  updateOriginAndChangedWH(): void;
324
336
  setSyncsliceNum(): void;
325
337
  resetPaintAreaUIPosition(l?: number, t?: number): void;
@@ -2,6 +2,7 @@ import type { INewMaskData } from "./core/types";
2
2
  import type { MaskVolume } from "./core/index";
3
3
  import type { CanvasState } from "./CanvasState";
4
4
  import type { MaskMirror } from "./tools/MaskMirror";
5
+ import { type HeatmapOverlay } from "./tools/HeatmapOverlay";
5
6
  /**
6
7
  * RenderingUtils — Rendering / slice-buffer helper methods.
7
8
  *
@@ -18,6 +19,8 @@ export declare class RenderingUtils {
18
19
  setEmptyCanvasSize: (axis?: "x" | "y" | "z") => void;
19
20
  /** Set while this viewer draws another viewer's masks; painted after this viewer's own layers. */
20
21
  mirror: MaskMirror | null;
22
+ /** The probability heatmap; painted instead of the layers while the heatmap view is on. */
23
+ heatmap: HeatmapOverlay | null;
21
24
  /** Called after every composite. The owner refreshes the viewers mirroring this one. */
22
25
  onComposited: (() => void) | null;
23
26
  private _reusableSliceBuffer;
@@ -279,7 +279,16 @@ export interface ILayerChannelState {
279
279
  /** Per-layer opacity: { layer1: 1.0, layer2: 0.6, ... }. Range [0.1, 1.0]. */
280
280
  layerOpacity: Record<string, number>;
281
281
  }
282
+ /** The probability heatmap view. While visible it is drawn instead of every mask layer. */
283
+ export interface IHeatmapViewState {
284
+ visible: boolean;
285
+ /** Probabilities below this (0–1) are not drawn. */
286
+ threshold: number;
287
+ /** 0–1. */
288
+ opacity: number;
289
+ }
282
290
  export interface IGUIStates extends IToolModeState, IDrawingConfig, IViewConfig, ILayerChannelState {
291
+ heatmap: IHeatmapViewState;
283
292
  }
284
293
  /** Metadata for a GUI slider/control — used by Vue components to configure slider UI */
285
294
  export interface IGuiMeta {
@@ -1,18 +1,20 @@
1
1
  /**
2
2
  * GuiState — Grouped state management for GUI configuration.
3
3
  *
4
- * Replaces the flat IGUIStates object with 4 semantic sub-groups:
4
+ * Replaces the flat IGUIStates object with 5 semantic sub-groups:
5
5
  * - mode: Tool mode flags (pencil/eraser/sphere)
6
6
  * - drawing: Brush/pencil appearance and behavior
7
7
  * - viewConfig: UI layout and interaction parameters
8
8
  * - layerChannel: Active layer, channel, and visibility
9
+ * - heatmap: Probability heatmap view: shown, threshold, opacity
9
10
  */
10
- import type { IToolModeState, IDrawingConfig, IViewConfig, ILayerChannelState } from "../core/types";
11
+ import type { IToolModeState, IDrawingConfig, IViewConfig, ILayerChannelState, IHeatmapViewState } from "../core/types";
11
12
  export declare class GuiState {
12
13
  readonly mode: IToolModeState;
13
14
  readonly drawing: IDrawingConfig;
14
15
  readonly viewConfig: IViewConfig;
15
16
  readonly layerChannel: ILayerChannelState;
17
+ readonly heatmap: IHeatmapViewState;
16
18
  constructor(options?: {
17
19
  defaultPaintCursor?: string;
18
20
  defaultFillColor?: string;
@@ -0,0 +1,37 @@
1
+ type Axis = "x" | "y" | "z";
2
+ /** 256 × RGBA: probability byte → colour. */
3
+ export declare const HEATMAP_COLORMAP: Uint8ClampedArray;
4
+ /** The smallest byte drawn for a 0–1 threshold. */
5
+ export declare function heatmapThresholdByte(t: number): number;
6
+ /** Whether the heatmap view is on. Older state fakes carry no `heatmap`. */
7
+ export declare function isHeatmapShown(state: {
8
+ gui_states: unknown;
9
+ }): boolean;
10
+ /** The most raster pixels per voxel along an axis. */
11
+ export declare const HEATMAP_MAX_UPSAMPLE = 4;
12
+ export declare class HeatmapOverlay {
13
+ readonly dims: [number, number, number];
14
+ private volume;
15
+ private makeCanvas;
16
+ private cache;
17
+ /** The offscreen canvas and its pixels, kept while the raster size stays the same. */
18
+ private raster;
19
+ constructor(volume: Uint8Array, dims: [number, number, number], makeCanvas?: (w: number, h: number) => HTMLCanvasElement);
20
+ /** Raster pixels per voxel along one axis: enough for the displayed size, at most HEATMAP_MAX_UPSAMPLE. */
21
+ static rasterFactor(displayed: number, voxels: number): number;
22
+ /**
23
+ * One slice as RGBA at `fx × fy` raster pixels per voxel. The probability is interpolated
24
+ * bilinearly between voxel centres; a pixel is drawn, in the colour of that value, where it
25
+ * reaches `thresholdByte`. Elsewhere it is fully transparent. With `out` (exactly
26
+ * `width × height × 4` bytes) the slice is written into it, cleared first, instead of a new array.
27
+ * `fx` and `fy` must be integers of at least 1.
28
+ */
29
+ sliceRGBA(axis: Axis, index: number, thresholdByte: number, fx?: number, fy?: number, outBytes?: Uint8ClampedArray): {
30
+ data: Uint8ClampedArray;
31
+ width: number;
32
+ height: number;
33
+ };
34
+ /** Draw a slice scaled to `width × height`; the offscreen slice is reused until its key changes. */
35
+ paint(ctx: CanvasRenderingContext2D, axis: Axis, index: number, width: number, height: number, threshold: number, opacity: number): void;
36
+ }
37
+ export {};
@@ -18,6 +18,7 @@ import { NrrdTools } from "./Utils/segmentation/NrrdTools";
18
18
  import { registerNiftiMaskGrid } from "./Utils/segmentation/tools/DataLoader";
19
19
  import type { NrrdHeaderLike } from "./Utils/segmentation/tools/DataLoader";
20
20
  import { GaussianSmoother } from "./Utils/segmentation/core/GaussianSmoother";
21
+ import { HEATMAP_COLORMAP, heatmapThresholdByte } from "./Utils/segmentation/tools/HeatmapOverlay";
21
22
  import { Copper3dTrackballControls } from "./Controls/Copper3dTrackballControls";
22
23
  import { Copper3dOrbitControls } from "./Controls/Copper3dOrbitControls";
23
24
  import { MeshNodeTool } from "./Utils/MeshNodeTool";
@@ -65,6 +66,6 @@ import { OrientationError, canonicalTransform, geometryFromNrrd, readNrrdOrienta
65
66
  import type { NrrdOrientationFields, OrientationErrorCode, OrientationTransform, ViewAxis, ViewLabels, VolumeGeometry, VolumeOrientation } from "./Utils/orientation";
66
67
  import "./css/style.css";
67
68
  export declare const REVISION: string;
68
- export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, loadKiwrious, NrrdTools, registerNiftiMaskGrid, loading, Copper3dTrackballControls, Copper3dOrbitControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, MAX_ENGINE_CHANNEL, CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, SurfaceAnnotator, exposureExponent, DEFAULT_TARGET_GREY, disposeObject3D, disposeMaterial, collectFadeTargets, setFade, restoreFade, createSceneBudget, defaultBudgetBytes, disposeScene, removeSceneFromMap, fitDistance, fitView, isRotateEnabled, setRotateEnabled, isPanEnabled, setPanEnabled, isZoomEnabled, setZoomEnabled, beginGesture, isGestureActive, setCameraPose, addVolumeBoundingBox, VOLUME_BOUNDS_NAME, rasDimensions, DEFAULT_AXES, ensureAxisExtracted, prepareVolumeSlices, copperGltfLoader, setDracoDecoderPath, setKTX2TranscoderPath, easeInOutCubic, viewPointToPose, rotateAroundAxis, interpolateFlightPose, poseDistance, orbitStepPose, zoomPose, orbitSwingAngle, installFastSliceRepaint, OrientationError, canonicalTransform, geometryFromNrrd, readNrrdOrientationFields, reorientVoxels, reorientedGeometry, viewLabels, };
69
+ export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, loadKiwrious, NrrdTools, registerNiftiMaskGrid, loading, Copper3dTrackballControls, Copper3dOrbitControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, MAX_ENGINE_CHANNEL, CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, HEATMAP_COLORMAP, heatmapThresholdByte, SurfaceAnnotator, exposureExponent, DEFAULT_TARGET_GREY, disposeObject3D, disposeMaterial, collectFadeTargets, setFade, restoreFade, createSceneBudget, defaultBudgetBytes, disposeScene, removeSceneFromMap, fitDistance, fitView, isRotateEnabled, setRotateEnabled, isPanEnabled, setPanEnabled, isZoomEnabled, setZoomEnabled, beginGesture, isGestureActive, setCameraPose, addVolumeBoundingBox, VOLUME_BOUNDS_NAME, rasDimensions, DEFAULT_AXES, ensureAxisExtracted, prepareVolumeSlices, copperGltfLoader, setDracoDecoderPath, setKTX2TranscoderPath, easeInOutCubic, viewPointToPose, rotateAroundAxis, interpolateFlightPose, poseDistance, orbitStepPose, zoomPose, orbitSwingAngle, installFastSliceRepaint, OrientationError, canonicalTransform, geometryFromNrrd, readNrrdOrientationFields, reorientVoxels, reorientedGeometry, viewLabels, };
69
70
  export type { positionType, screenPosType, optsType, NrrdHeaderLike, GltfLoadOpts, nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, IPaintImage, exportPaintImageType, IOptVTKLoader, aligned4DSurfaceType, aligned4DOptsType, Aligned4DController, raw4DVolumeTransformType, raw4DVolumeOptsType, Raw4DVolumeController, ICommXYZ, IGUIStates, IGuiParameterSettings, INrrdStates, NrrdState, GuiState, IGuiMeta, ToolMode, IAnnotationCallbacks, IMaskHistoryChange, MaskRenderMode, LayerId, ChannelValue, ChannelClear, AiPromptTool, AiPromptPoint, AiPromptPayload, AiMaskResult, SurfaceAnnotatorOptions, Annotation, AnnotationMode, ExportOptions, ExposureVolume, DisposableObject3D, DisposableMaterial, FadeTarget, FadeableMaterial, SceneBudget, DisposableScene, SceneDisposalHost, FitBounds, FitViewScene, AxisGatedControls, GestureAxes, PosableScene, BoundingBoxHost, VolumeBoundingBoxOpts, NrrdAxis, Pose, NrrdOrientationFields, OrientationErrorCode, OrientationTransform, ViewAxis, ViewLabels, VolumeGeometry, VolumeOrientation, };
70
71
  export type { CameraViewPreset } from "./Controls/orbitFraming";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "copper3d",
3
3
  "description": "A 3d visualisation package base on threejs provides multiple scenes and Nrrd image load funtion.",
4
- "version": "4.1.4",
4
+ "version": "4.2.1",
5
5
  "main": "dist/bundle.umd.js",
6
6
  "module": "dist/bundle.esm.mjs",
7
7
  "types": "dist/types/index.d.ts",