Class: Resampler
Defined in: src/resampling/Resampler.ts:21
Resampling implementation for NeuroVol
Implements
Constructors
Constructor
new Resampler(volume): Resampler;Defined in: src/resampling/Resampler.ts:24
Parameters
volume
Returns
Resampler
Methods
resample()
resample(targetSpace, options?): NeuroVol;Defined in: src/resampling/Resampler.ts:31
Resample volume to new space/resolution
Parameters
targetSpace
options?
ResampleOptions = {}
Returns
Implementation of
resampleToDimensions()
resampleToDimensions(dimensions, options?): NeuroVol;Defined in: src/resampling/Resampler.ts:79
Resample to specific voxel dimensions
Parameters
dimensions
[number, number, number]
options?
Returns
Implementation of
IResampler.resampleToDimensions
resampleToVoxelSize()
resampleToVoxelSize(voxelSize, options?): NeuroVol;Defined in: src/resampling/Resampler.ts:103
Resample to specific voxel size
Parameters
voxelSize
[number, number, number]
options?
Returns
Implementation of
IResampler.resampleToVoxelSize
transform()
transform(options, resampleOptions?): NeuroVol;Defined in: src/resampling/Resampler.ts:139
Apply an affine transformation to the volume, resampling onto a grid of the same dimensions/spacing as the input.
The transform is expressed in voxel (grid) coordinates. The forward map sends an input voxel p to an output voxel q via
q = M * (p - center) + center + translation
where M = R * S (rotation composed with scale). Resampling fills each OUTPUT voxel q by mapping it back into the INPUT volume with the inverse transform and sampling there:
p = M^-1 * (q - center - translation) + center
Parameters
options
resampleOptions?
ResampleOptions = {}
Returns
Implementation of
interpolateAt()
interpolateAt(
x,
y,
z,
method?): number;Defined in: src/resampling/Resampler.ts:180
Interpolate value at continuous coordinate
Parameters
x
number
y
number
z
number
method?
InterpolationMethod = 'linear'
Returns
number
Implementation of
downsample()
downsample(factor, options?): NeuroVol;Defined in: src/resampling/Resampler.ts:187
Downsample by integer factor
Parameters
factor
number
options?
Returns
Implementation of
upsample()
upsample(factor, options?): NeuroVol;Defined in: src/resampling/Resampler.ts:204
Upsample by integer factor
Parameters
factor
number
options?
Returns
Implementation of
resampleClustered()
static resampleClustered(source, targetSpace): ClusteredNeuroVol;Defined in: src/resampling/Resampler.ts:225
Resample a ClusteredNeuroVol to a new target space.
Uses nearest-neighbour interpolation to preserve integer labels. The algorithm:
- Resample labels (dense Int32 representation) with nearest-neighbour
- Resample the mask with nearest-neighbour
- Keep voxels where both resampled mask and label are non-zero
- Build a new ClusteredNeuroVol with the surviving labels