Package sc.fiji.snt.io
Class SpimDataUtils.CalibratedSource<T extends net.imglib2.type.numeric.NumericType<T>>
java.lang.Object
bdv.util.AbstractSource<T>
bdv.util.RandomAccessibleIntervalSource<T>
sc.fiji.snt.io.SpimDataUtils.CalibratedSource<T>
- Type Parameters:
T- the pixel type
- All Implemented Interfaces:
bdv.viewer.Source<T>
- Enclosing class:
SpimDataUtils
public static class SpimDataUtils.CalibratedSource<T extends net.imglib2.type.numeric.NumericType<T>>
extends bdv.util.RandomAccessibleIntervalSource<T>
Wraps a
RandomAccessibleIntervalSource and overrides
getVoxelDimensions() to carry the physical unit (e.g. "µm").
Without this, BDV's ScaleBarOverlayRenderer reads "pixel"
from RandomAccessibleIntervalSource.getVoxelDimensions() and the
scale bar label is wrong even when calibration is applied.-
Field Summary
Fields inherited from class bdv.util.AbstractSource
interpolators, name, type -
Constructor Summary
ConstructorsConstructorDescriptionCalibratedSource(net.imglib2.RandomAccessibleInterval<T> rai, T type, net.imglib2.realtransform.AffineTransform3D sourceTransform, String name, double[] cal, String unit) Convenience constructor for sources without a time axis (timeDim = -1).CalibratedSource(net.imglib2.RandomAccessibleInterval<T> rai, T type, net.imglib2.realtransform.AffineTransform3D sourceTransform, String name, double[] cal, String unit, int timeDim) Full constructor. -
Method Summary
Modifier and TypeMethodDescriptionnet.imglib2.RandomAccessibleInterval<T> getSource(int t, int level) mpicbg.spim.data.sequence.VoxelDimensionsvoidsetCalibration(double[] cal, String unit) Updates the voxel calibration (spacing and unit) of this source.Methods inherited from class bdv.util.RandomAccessibleIntervalSource
getInterpolatedSource, getSourceTransformMethods inherited from class bdv.util.AbstractSource
doBoundingBoxCulling, getInterpolatedMaskedSource, getMaskedSource, getName, getNumMipmapLevels, getType, isPresent
-
Constructor Details
-
CalibratedSource
public CalibratedSource(net.imglib2.RandomAccessibleInterval<T> rai, T type, net.imglib2.realtransform.AffineTransform3D sourceTransform, String name, double[] cal, String unit, int timeDim) Full constructor. WhentimeDim >= 0,getSource(int, int)slices the RAI along that axis so each BVV timepoint returns the correct frame.RandomAccessibleIntervalSourceignores the timepoint argument entirely, causing all frames to show frame 0 for timelapse data. -
CalibratedSource
public CalibratedSource(net.imglib2.RandomAccessibleInterval<T> rai, T type, net.imglib2.realtransform.AffineTransform3D sourceTransform, String name, double[] cal, String unit) Convenience constructor for sources without a time axis (timeDim = -1).
-
-
Method Details
-
setCalibration
Updates the voxel calibration (spacing and unit) of this source. Mutates the source transform diagonal and replaces theVoxelDimensionsso the BVV scale bar reflects the new values.- Parameters:
cal- voxel spacing {x, y, z}unit- physical unit string (e.g. "µm")
-
getSource
-
getVoxelDimensions
public mpicbg.spim.data.sequence.VoxelDimensions getVoxelDimensions()
-