Skip to content

copper3d / Modules / Loader/copperNrrdLoader

Module: Loader/copperNrrdLoader

Table of contents

Interfaces

Type Aliases

Variables

Functions

Type Aliases

NrrdAxis

Ƭ NrrdAxis: "x" | "y" | "z"

A slice axis, in the sense Volume.extractSlice uses.

Defined in

src/Loader/copperNrrdLoader.ts:214

Variables

DEFAULT_AXES

Const DEFAULT_AXES: readonly NrrdAxis[]

All three, which is what loadNrrd has always extracted.

Defined in

src/Loader/copperNrrdLoader.ts:217

Functions

__setNrrdWorkerFactoryForTests

__setNrrdWorkerFactoryForTests(factory): void

Test-only seam. Production code always goes through createRealNrrdWorker, which constructs a real Worker (?worker&inline, so the plugin build never needs a second asset file at an unpredictable base path). jsdom (this repo's test environment) has no Worker implementation at all, so tests substitute an in-process double that drives the exact same nrrdWorkerCore.ts logic the real worker entry uses -- see __tests__/helpers/fakeNrrdWorker.ts. Passing null restores the real worker factory.

Parameters

NameType
factorynull | () => NrrdWorkerLike

Returns

void

Defined in

src/Loader/copperNrrdLoader.ts:46


addBoxHelper

addBoxHelper(scene, volume, boxCube?): void

Parameters

NameType
scenecopperScene
volumeany
boxCube?Object3D<Object3DEventMap>

Returns

void

Deprecated

Since 3.9.0, use addVolumeBoundingBox(scene, rasDimensions).

Kept unchanged for callers passing their own boxCube, which works. The two-argument form does not: cube is declared in this module and never assigned, so it reaches new THREE.BoxHelper(undefined). This also cannot take a copperSceneOnDemond -- a sibling of copperScene, not a descendant -- and sizes the box from volume.matrix rather than its RAS dimensions.

Defined in

src/Loader/copperNrrdLoader.ts:787


copperNrrdLoader

copperNrrdLoader(url, loadingBar, segmentation, callback?, opts?): void

Parameters

NameType
urlstring
loadingBarloadingBarType
segmentationboolean
callback?(volume: any, nrrdMeshes: nrrdMeshesType, nrrdSlices: nrrdSliceType, gui?: GUI) => void
opts?optsType

Returns

void

Defined in

src/Loader/copperNrrdLoader.ts:345


copperNrrdTexture3dLoader

copperNrrdTexture3dLoader(url, scene, container, callback?): void

Parameters

NameType
urlstring
sceneScene<Object3DEventMap>
containerHTMLDivElement
callback?(volume: any, gui?: GUI) => void

Returns

void

Defined in

src/Loader/copperNrrdLoader.ts:520


ensureAxisExtracted

ensureAxisExtracted(slices, axis, meshes?): any

Extracts a slice plane a narrower axes load skipped, the first time something asks for it (see NrrdTools.setSliceOrientation). Mutates slices (and meshes, if given) in place so every existing reference to the same object -- there is exactly one per volume -- picks up the new plane; callers do not need to replace anything. A no-op if the axis is already present.

All three axes' slices share one Volume instance (see onLoad below), so whichever axis IS already extracted is where the volume, dimensions, spacing and RAS dimensions are read from -- there is no separate "the volume" reference kept around for this.

Parameters

NameType
slicesnrrdSliceType
axisNrrdAxis
meshes?nrrdMeshesType

Returns

any

Defined in

src/Loader/copperNrrdLoader.ts:313


getWholeSlices

getWholeSlices(nrrdSlices, scene, gui, controls): void

Parameters

NameType
nrrdSlicesnrrdSliceType
sceneScene<Object3DEventMap>
guiGUI
controlsCopper3dTrackballControls

Returns

void

Defined in

src/Loader/copperNrrdLoader.ts:678