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

    Constructors
    Constructor
    Description
    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).
    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 Type
    Method
    Description
    net.imglib2.RandomAccessibleInterval<T>
    getSource(int t, int level)
     
    mpicbg.spim.data.sequence.VoxelDimensions
     
    void
    setCalibration(double[] cal, String unit)
    Updates the voxel calibration (spacing and unit) of this source.

    Methods inherited from class bdv.util.RandomAccessibleIntervalSource

    getInterpolatedSource, getSourceTransform

    Methods inherited from class bdv.util.AbstractSource

    doBoundingBoxCulling, getInterpolatedMaskedSource, getMaskedSource, getName, getNumMipmapLevels, getType, isPresent

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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. When timeDim >= 0, getSource(int, int) slices the RAI along that axis so each BVV timepoint returns the correct frame. RandomAccessibleIntervalSource ignores 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

      public void setCalibration(double[] cal, String unit)
      Updates the voxel calibration (spacing and unit) of this source. Mutates the source transform diagonal and replaces the VoxelDimensions so the BVV scale bar reflects the new values.
      Parameters:
      cal - voxel spacing {x, y, z}
      unit - physical unit string (e.g. "µm")
    • getSource

      public net.imglib2.RandomAccessibleInterval<T> getSource(int t, int level)
      Specified by:
      getSource in interface bdv.viewer.Source<T extends net.imglib2.type.numeric.NumericType<T>>
      Overrides:
      getSource in class bdv.util.RandomAccessibleIntervalSource<T extends net.imglib2.type.numeric.NumericType<T>>
    • getVoxelDimensions

      public mpicbg.spim.data.sequence.VoxelDimensions getVoxelDimensions()
      Specified by:
      getVoxelDimensions in interface bdv.viewer.Source<T extends net.imglib2.type.numeric.NumericType<T>>
      Overrides:
      getVoxelDimensions in class bdv.util.AbstractSource<T extends net.imglib2.type.numeric.NumericType<T>>