Skip to content

copper3d / Modules / Loader/copperNrrdLoader / optsType

Interface: optsType ​

Loader/copperNrrdLoader.optsType

Table of contents ​

Properties ​

Properties ​

axes ​

• Optional axes: readonly NrrdAxis[]

Which slice planes to extract. Defaults to all three, i.e. exactly what previous versions did.

Narrow it when you display fewer. extractSlice walks the whole volume per call and the result is retained on volume.sliceList for the volume's lifetime, so an axis you never show costs a full pass over a 50MB buffer plus a geometry, a material and a canvas-backed texture that nothing ever frees.

WARNING

The omitted axes are undefined on the nrrdMeshes / nrrdSlices the callback receives. Their types still declare all three present -- widening them to optional would break every existing caller's compile -- so a caller that narrows axes is responsible for only reading what it asked for.

Defined in ​

src/Loader/copperNrrdLoader.ts:251


container ​

• Optional container: HTMLDivElement

Defined in ​

src/Loader/copperNrrdLoader.ts:232


knownMinMax ​

• Optional knownMinMax: [number, number]

The volume's whole-intensity [min, max], already known (e.g. from the backend's /files/{case_id}/headers, which reads it once from the same bytes the backend already decompresses). When supplied, Volume.computeMinMax() uses it instead of scanning every voxel in the browser -- the single largest function in a case-load CPU profile. Omit it (or pass a stale/wrong-looking one) and behaviour is exactly as before: three's own scan runs and the image comes out identical, just slower.

Defined in ​

src/Loader/copperNrrdLoader.ts:275


onError ​

• Optional onError: (error: unknown) => void

Type declaration ​

▸ (error): void

Fetch or parse failure. New in 3.9.0; there was no error channel at all before, so a failed volume was indistinguishable from a slow one and the callback simply never fired.

Parameters ​
NameType
errorunknown
Returns ​

void

Defined in ​

src/Loader/copperNrrdLoader.ts:266


onProgress ​

• Optional onProgress: (event: ProgressEvent<EventTarget>) => void

Type declaration ​

▸ (event): void

Download progress, in ADDITION to the built-in loading bar -- that keeps writing its percentage into loadingBar.progress exactly as before.

New in 3.9.0. Until then the loading bar's text was the only progress signal copper3d exposed, so a caller that needed to know a large download was still alive had to watch that DOM node for mutations.

Parameters ​
NameType
eventProgressEvent<EventTarget>
Returns ​

void

Defined in ​

src/Loader/copperNrrdLoader.ts:260


openGui ​

• openGui: boolean

Defined in ​

src/Loader/copperNrrdLoader.ts:231


signal ​

• Optional signal: AbortSignal

Aborts the in-flight fetch. A superseded load (case switch, series switch) can now stop its transfer instead of only having its eventual result discarded -- see abandonLoad in LeftPanelCore.vue. onError still fires for an aborted fetch (the browser rejects it like any other failed fetch); callers that already ignore errors from a stale load need no further change.

Defined in ​

src/Loader/copperNrrdLoader.ts:283