copper3d 4.1.0 → 4.1.2
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 +0 -4
- package/ai-index/guides/nrrd-tools.md +10 -0
- package/ai-index/guides/orientation.md +8 -0
- package/ai-index/manifest.json +4 -4
- package/ai-index/symbols.json +1 -1
- package/dist/Scene/copperSceneOnDemond.d.ts +16 -0
- package/dist/Scene/copperSceneOnDemond.js +41 -0
- package/dist/Scene/copperSceneOnDemond.js.map +1 -1
- package/dist/Utils/segmentation/DrawToolCore.d.ts +18 -1
- package/dist/Utils/segmentation/DrawToolCore.js +31 -6
- package/dist/Utils/segmentation/DrawToolCore.js.map +1 -1
- package/dist/Utils/segmentation/NrrdTools.d.ts +3 -2
- package/dist/Utils/segmentation/NrrdTools.js +3 -2
- package/dist/Utils/segmentation/NrrdTools.js.map +1 -1
- package/dist/bundle.esm.mjs +95 -16
- package/dist/bundle.umd.js +99 -20
- package/dist/orientation.cjs +276 -0
- package/dist/orientation.mjs +262 -0
- package/dist/types/Scene/copperSceneOnDemond.d.ts +16 -0
- package/dist/types/Utils/segmentation/DrawToolCore.d.ts +18 -1
- package/dist/types/Utils/segmentation/NrrdTools.d.ts +3 -2
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -58,10 +58,6 @@ with VitePress and deploys to GitHub Pages.
|
|
|
58
58
|
> rather than `copperRenderer`, and nothing from the 3.x segmentation engine. Everything now
|
|
59
59
|
> lives at the link above. Its sources remain in git history if you need them.
|
|
60
60
|
|
|
61
|
-
### Previous versions
|
|
62
|
-
|
|
63
|
-
Old: https://www.npmjs.com/package/copper3d_visualisation
|
|
64
|
-
Very old: https://www.npmjs.com/package/gltfloader-plugin-test
|
|
65
61
|
|
|
66
62
|
### Examples
|
|
67
63
|
|
|
@@ -415,6 +415,16 @@ const callbackId = scene.addPreRenderCallbackFunction(nrrdTools.start);
|
|
|
415
415
|
scene.removePreRenderCallbackFunction(callbackId);
|
|
416
416
|
```
|
|
417
417
|
|
|
418
|
+
::: tip On-demand scenes, and registering early <Badge type="tip" text="4.1.2" />
|
|
419
|
+
This works on `copperSceneOnDemond` too. While anything is registered, an on-demand scene runs
|
|
420
|
+
a `requestAnimationFrame` loop that calls the callbacks and nothing else; the 3D scene still
|
|
421
|
+
renders only on demand. Before 4.1.2 it accepted the registration and never called it.
|
|
422
|
+
|
|
423
|
+
`nrrdTools.start` is one function for the life of the instance, so it may be registered before
|
|
424
|
+
`draw()`. It does nothing until `draw()` has run and the first slice has sized the canvases.
|
|
425
|
+
Before 4.1.2, registering before `draw()` registered an empty function that stayed empty.
|
|
426
|
+
:::
|
|
427
|
+
|
|
418
428
|
#### Manual render loop
|
|
419
429
|
|
|
420
430
|
```typescript
|
|
@@ -147,6 +147,14 @@ const voxels = reorientVoxels(raw, geometry.dims, t);
|
|
|
147
147
|
const grid = reorientedGeometry(geometry, t);
|
|
148
148
|
```
|
|
149
149
|
|
|
150
|
+
In Node (a converter, a server, a test), prefer `copper3d/orientation`. It is the same
|
|
151
|
+
functions with nothing else attached — no three, no WebGL, no rest of the library — as ESM
|
|
152
|
+
or CommonJS.
|
|
153
|
+
|
|
154
|
+
```ts
|
|
155
|
+
import { canonicalTransform, geometryFromNrrd } from "copper3d/orientation";
|
|
156
|
+
```
|
|
157
|
+
|
|
150
158
|
::: tip Masks must be reoriented the same way
|
|
151
159
|
A mask you bring in from elsewhere is in *its* file's order. Put it through the same
|
|
152
160
|
`canonicalTransform` / `reorientVoxels` pair before handing it to `setMasksFromNIfTI`, or it
|
package/ai-index/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"copper3dVersion": "4.1.
|
|
4
|
-
"generatedAt": "2026-10-
|
|
3
|
+
"copper3dVersion": "4.1.2",
|
|
4
|
+
"generatedAt": "2026-10-20T08:42:30.496Z",
|
|
5
5
|
"symbolCount": 1204,
|
|
6
6
|
"guides": [
|
|
7
7
|
{
|
|
@@ -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": 82294
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
"id": "on-demand-controls",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"title": "Patient Orientation <Badge type=\"tip\" text=\"4.1.0\" />",
|
|
107
107
|
"summary": "Every volume `loadNrrd` returns is in the **canonical voxel order**, whatever order its file stores. That is what makes each view come out in the radiological convention without the caller doing anything.",
|
|
108
108
|
"lang": "en",
|
|
109
|
-
"bytes":
|
|
109
|
+
"bytes": 6387
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
112
|
"id": "rotation-pivot",
|