copper3d 3.11.2 → 3.11.3
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.
- package/README.md +22 -1
- package/ai-index/guides/nrrd-tools.md +52 -1
- package/ai-index/guides/segmentation-module.md +5 -2
- package/ai-index/manifest.json +5 -5
- package/ai-index/symbols.json +1 -1
- package/dist/Utils/segmentation/NrrdTools.d.ts +13 -0
- package/dist/Utils/segmentation/NrrdTools.js +28 -2
- package/dist/Utils/segmentation/NrrdTools.js.map +1 -1
- package/dist/Utils/segmentation/core/types.d.ts +2 -0
- package/dist/Utils/segmentation/coreTools/NrrdState.d.ts +1 -1
- package/dist/Utils/segmentation/coreTools/NrrdState.js +3 -2
- package/dist/Utils/segmentation/coreTools/NrrdState.js.map +1 -1
- package/dist/Utils/segmentation/coreTools/gui.js +1 -1
- package/dist/Utils/segmentation/coreTools/gui.js.map +1 -1
- package/dist/Utils/segmentation/tools/SliceRenderPipeline.js +4 -2
- package/dist/Utils/segmentation/tools/SliceRenderPipeline.js.map +1 -1
- package/dist/Utils/segmentation/tools/ZoomTool.js +5 -2
- package/dist/Utils/segmentation/tools/ZoomTool.js.map +1 -1
- package/dist/bundle.esm.js +44 -12
- package/dist/bundle.umd.js +44 -12
- package/dist/types/Utils/segmentation/NrrdTools.d.ts +13 -0
- package/dist/types/Utils/segmentation/core/types.d.ts +2 -0
- package/dist/types/Utils/segmentation/coreTools/NrrdState.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -509,6 +509,25 @@ leave outline mode to annotate.
|
|
|
509
509
|
|
|
510
510
|
---
|
|
511
511
|
|
|
512
|
+
### Zoom range — showing below 1:1
|
|
513
|
+
|
|
514
|
+
The zoom factor used to bottom out at `1`. Lower the floor and a large volume can be fitted
|
|
515
|
+
into a small panel:
|
|
516
|
+
|
|
517
|
+
```typescript
|
|
518
|
+
nrrdTools.setMinSizeFactor(0.5); // clamped to [0.05, 1]; default 1
|
|
519
|
+
nrrdTools.setMainAreaSize(0.6); // now valid
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
`setMainAreaSize`, wheel zoom and the `"mainAreaSize"` GUI slider all follow it; the upper
|
|
523
|
+
bound stays `8`. If the current factor is below the new floor it is raised and repainted.
|
|
524
|
+
|
|
525
|
+
The engine never recomputes the floor — the right value depends on the image and axis
|
|
526
|
+
dimensions *and* your panel size — so re-apply it after each case load, axis switch and panel
|
|
527
|
+
resize.
|
|
528
|
+
|
|
529
|
+
---
|
|
530
|
+
|
|
512
531
|
### 7. Channel Color Customization
|
|
513
532
|
|
|
514
533
|
**Default colors:**
|
|
@@ -697,7 +716,9 @@ yourself. It throws on an unknown layer, or a channel outside `[1, 255]`.
|
|
|
697
716
|
| **Actions** | `executeAction(action, opts?)` | Run: `"undo"` / `"redo"` / `"clearActiveSliceMask"` / `"clearActiveLayerMask"` / `"resetZoom"` / `"downloadCurrentMask"` / `"gaussianSmooth"` (takes `{ sigma? }`) |
|
|
698
717
|
| **Navigation** | `setSliceOrientation(axis)` | Switch viewing axis `"x"` / `"y"` / `"z"`; extracts the plane on demand if the load skipped it |
|
|
699
718
|
| | `setSliceMoving(step)` | Step the current slice (coalesced per animation frame) |
|
|
700
|
-
| | `setMainAreaSize(factor)` | Set the main-area zoom factor [
|
|
719
|
+
| | `setMainAreaSize(factor)` | Set the main-area zoom factor `[minSizeFactor, 8]` |
|
|
720
|
+
| | `setMinSizeFactor(f)` | Lower the zoom floor below 1:1. Clamped to `[0.05, 1]`; default `1`. Re-apply after case loads, axis switches and panel resizes |
|
|
721
|
+
| | `getMinSizeFactor()` | Read the current zoom floor |
|
|
701
722
|
| **History** | `undo()` / `redo()` | Undo / redo last stroke |
|
|
702
723
|
| **Keyboard** | `setKeyboardSettings(partial)` | Remap shortcuts |
|
|
703
724
|
| | `getKeyboardSettings()` | Read current bindings |
|
|
@@ -1286,6 +1286,55 @@ Set the base display size multiplier (1–8). Larger values use more GPU memory
|
|
|
1286
1286
|
nrrdTools.setBaseDrawDisplayCanvasesSize(2); // 2× base resolution
|
|
1287
1287
|
```
|
|
1288
1288
|
|
|
1289
|
+
#### Zoom range — `setMinSizeFactor()` <Badge type="tip" text="3.11.3" />
|
|
1290
|
+
|
|
1291
|
+
The 2D zoom factor (`sizeFactor`) used to bottom out at `1`, i.e. 1:1 with the image. Lower
|
|
1292
|
+
the floor and the image can be shown **smaller than its original size** — which is what a
|
|
1293
|
+
large volume in a small panel needs:
|
|
1294
|
+
|
|
1295
|
+
```typescript
|
|
1296
|
+
nrrdTools.setMinSizeFactor(0.5); // allow down to half size
|
|
1297
|
+
nrrdTools.setMainAreaSize(0.6); // now valid
|
|
1298
|
+
const min = nrrdTools.getMinSizeFactor();
|
|
1299
|
+
```
|
|
1300
|
+
|
|
1301
|
+
| | |
|
|
1302
|
+
|---|---|
|
|
1303
|
+
| Accepted range | clamped to `[0.05, 1]`; a non-finite value resets it to `1` |
|
|
1304
|
+
| Default | `1` — exactly the previous behaviour |
|
|
1305
|
+
| Upper bound | still `8`, unchanged |
|
|
1306
|
+
|
|
1307
|
+
Everything that moves the zoom respects it: `setMainAreaSize`, wheel zoom, and
|
|
1308
|
+
`NrrdState.setZoomFactor`. The `"mainAreaSize"` GUI slider's `min` is updated too, so a
|
|
1309
|
+
connected dat.GUI / lil-gui panel can reach the new range.
|
|
1310
|
+
|
|
1311
|
+
If the current factor is **below** the new minimum it is raised to it and the view repaints
|
|
1312
|
+
immediately, so you can lower and raise the floor freely without leaving the view in an
|
|
1313
|
+
invalid state.
|
|
1314
|
+
|
|
1315
|
+
::: warning You have to re-apply it — the engine never recomputes it
|
|
1316
|
+
The minimum survives `reset()` and case loads, and the engine will not adjust it on its own:
|
|
1317
|
+
the right value depends on the image and axis dimensions *and* on the size of your panel,
|
|
1318
|
+
neither of which the engine knows. Re-apply it after each
|
|
1319
|
+
|
|
1320
|
+
- case load,
|
|
1321
|
+
- axis switch (`setSliceOrientation`), and
|
|
1322
|
+
- panel resize.
|
|
1323
|
+
|
|
1324
|
+
```typescript
|
|
1325
|
+
function fitFloor() {
|
|
1326
|
+
const [w, h] = nrrdTools.getCurrentImageDimension(); // per current axis
|
|
1327
|
+
const panel = container.getBoundingClientRect();
|
|
1328
|
+
nrrdTools.setMinSizeFactor(Math.min(panel.width / w, panel.height / h, 1));
|
|
1329
|
+
}
|
|
1330
|
+
```
|
|
1331
|
+
:::
|
|
1332
|
+
|
|
1333
|
+
::: tip A thin dimension never floors to zero
|
|
1334
|
+
`resizePaintArea` keeps a loaded image at **at least 1px** per axis, because a factor below 1
|
|
1335
|
+
could otherwise floor a thin dimension to `0`. An unloaded (0×0) image stays `0`.
|
|
1336
|
+
:::
|
|
1337
|
+
|
|
1289
1338
|
#### Reading image metadata
|
|
1290
1339
|
|
|
1291
1340
|
```typescript
|
|
@@ -1818,7 +1867,9 @@ cap it below what the byte allows. Capping it lower is your product's call, not
|
|
|
1818
1867
|
| | `GaussianSmoother.generateKernel1D(sigma)` | Generate a normalized 1D Gaussian kernel |
|
|
1819
1868
|
| **Navigation** | `setSliceOrientation(axis)` | Switch viewing axis `"x"` / `"y"` / `"z"`; extracts the plane on demand if the load skipped it |
|
|
1820
1869
|
| | `setSliceMoving(step)` | Step the current slice by `step` (coalesced into one `requestAnimationFrame`) |
|
|
1821
|
-
| | `setMainAreaSize(factor)` | Set the main-area zoom factor [
|
|
1870
|
+
| | `setMainAreaSize(factor)` | Set the main-area zoom factor `[minSizeFactor, 8]` and reposition the paint area |
|
|
1871
|
+
| | `setMinSizeFactor(f)` | Lower the zoom floor so the image can show below 1:1. Clamped to `[0.05, 1]`; default `1`. Not recomputed by the engine — re-apply after case loads, axis switches and panel resizes |
|
|
1872
|
+
| | `getMinSizeFactor()` | Read the current zoom floor |
|
|
1822
1873
|
| | `setCalculateDistanceSphere(x, y, slice, type)` | Programmatically place a calculator sphere (simulates full click flow: record origin → draw → write to volume) |
|
|
1823
1874
|
| **History** | `undo()` | Undo last stroke |
|
|
1824
1875
|
| | `redo()` | Redo last undone stroke |
|
|
@@ -546,7 +546,9 @@ nrrdTools.setCalculateDistanceSphere(200, 150, 42, 'skin');
|
|
|
546
546
|
| `switchAllSlicesArrayData(slices)` | Swap the loaded series and rebuild the display (resets view state) |
|
|
547
547
|
| `switchSlicesPreservingView(slices)` | Swap the loaded series via `switchPreservingView()`, keeping slice index, zoom and pan |
|
|
548
548
|
| `setSliceMoving(step)` | Step the current slice; steps are accumulated and applied in one `requestAnimationFrame` |
|
|
549
|
-
| `setMainAreaSize(factor)` | Clamp the zoom factor to [
|
|
549
|
+
| `setMainAreaSize(factor)` | Clamp the zoom factor to `[view.minSizeFactor, 8]`, resize the paint area and reset its UI position |
|
|
550
|
+
| `setMinSizeFactor(f)` | Lower bound for `sizeFactor`, clamped to `[0.05, 1]` (non-finite → `1`). Also updates `guiParameterSettings.advance.mainAreaSize.min`, and raises + repaints the current factor if it is now below the floor. Never recomputed by the engine — it depends on image/axis dimensions *and* host panel size |
|
|
551
|
+
| `getMinSizeFactor()` | Read the current floor |
|
|
550
552
|
| `setBaseDrawDisplayCanvasesSize(size)` | Set canvas base size multiplier (1–8) |
|
|
551
553
|
| `setupGUI(gui)` | Set up the dat.GUI panel |
|
|
552
554
|
| `enableContrastDragEvents(callback)` | Enable contrast drag (window/level) events |
|
|
@@ -589,7 +591,8 @@ NrrdState groups 44 properties into 5 semantic sub-objects:
|
|
|
589
591
|
| `currentSliceIndex` | `number` | Current slice index |
|
|
590
592
|
| `maxIndex` / `minIndex` | `number` | Slice index range |
|
|
591
593
|
| `changedWidth` / `changedHeight` | `number` | Canvas display dimensions |
|
|
592
|
-
| `sizeFactor` | `number` | Scale factor |
|
|
594
|
+
| `sizeFactor` | `number` | Scale factor. Clamped to `[minSizeFactor, 8]` everywhere it is written — `setMainAreaSize`, `ZoomTool`'s wheel, `NrrdState.setZoomFactor` |
|
|
595
|
+
| `minSizeFactor` | `number` | Lower bound for `sizeFactor`, in `[0.05, 1]`. Default `1` (never smaller than 1:1). Survives `reset()` and case loads |
|
|
593
596
|
| `originWidth` / `originHeight` | `number` | Original image dimensions |
|
|
594
597
|
|
|
595
598
|
#### nrrd_states.interaction (IInteractionState)
|
package/ai-index/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"copper3dVersion": "3.11.
|
|
4
|
-
"generatedAt": "2026-09-
|
|
5
|
-
"symbolCount":
|
|
3
|
+
"copper3dVersion": "3.11.3",
|
|
4
|
+
"generatedAt": "2026-09-30T00:54:40.159Z",
|
|
5
|
+
"symbolCount": 1199,
|
|
6
6
|
"guides": [
|
|
7
7
|
{
|
|
8
8
|
"id": "4D-MRI-LV-rendering",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"title": "NrrdTools Usage Guide",
|
|
91
91
|
"summary": "Copper3D `NrrdTools` — Medical Image Segmentation Annotation Engine",
|
|
92
92
|
"lang": "en",
|
|
93
|
-
"bytes":
|
|
93
|
+
"bytes": 74550
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
"id": "on-demand-controls",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"title": "Segmentation Module Documentation",
|
|
123
123
|
"summary": "⚠️ **Note**: All line number references in this document are from historical versions. After multiple rounds of refactoring (State Management Refactor, NrrdTools God Class Split, inheritance → composition refactor), these references are ou…",
|
|
124
124
|
"lang": "en",
|
|
125
|
-
"bytes":
|
|
125
|
+
"bytes": 74638
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
"id": "surface-annotation-api",
|