Skip to content

Commit bcbe50f

Browse files
wayfarer3130claude
andcommitted
docs(core): say why the labelmap voxel representation key is in core
A reviewer asked to move `segmentation.labelmapVoxelRepresentation` to cstools. The two kinds of setting are different, and the docstring now says so. `SegmentationConfig.overwriteMode` in `packages/tools/src/config.ts` is display and editing configuration, and cstools owns the editing. This key describes how core allocates the voxels of an image that core itself creates, so the key stays beside `imageLoader.ts`, which reads the key. Core cannot import cstools. Also replaces "live buffer" with "writable buffer" after the rename of `getLiveScalarData` to `getWritableScalarData`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 868850e commit bcbe50f

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎packages/core/src/types/Cornerstone3DConfig.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,14 @@ interface Cornerstone3DConfig {
103103
useGenericViewport?: boolean;
104104
};
105105

106+
/**
107+
* Core configuration for the labelmap images that core itself creates. This
108+
* is not the segmentation configuration of cstools: `overwriteMode` and the
109+
* rest of `SegmentationConfig` in `packages/tools/src/config.ts` describe
110+
* display and editing behaviour, which cstools owns. A setting here describes
111+
* how core allocates an image, so it stays beside the loader that reads it,
112+
* which cstools cannot do - core cannot import cstools.
113+
*/
106114
segmentation?: {
107115
/**
108116
* The voxel representation labelmap images are created with, for callers
@@ -115,7 +123,8 @@ interface Cornerstone3DConfig {
115123
* questions ("is segment N on this slice?") from the runs rather than a
116124
* whole-frame scan. Hosts that read labelmap pixels directly should opt in
117125
* knowingly: an RLE frame's `getScalarData()` is a fresh expansion, not the
118-
* live buffer, so in-place writes to it are discarded.
126+
* writable buffer, so in-place writes to it are discarded
127+
* (`getWritableScalarData()` returns undefined for such a frame).
119128
*
120129
* Accepts the bare string as well as the enum member, so this can come
121130
* straight from a host's JSON/deployment configuration. The value is

0 commit comments

Comments
 (0)