Class AlgorithmReslice

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.WindowListener, java.lang.Runnable, java.util.EventListener

    public class AlgorithmReslice
    extends AlgorithmBase
    Reslices 3D image into (isotropic)cubic voxels. This class assumes that the the X and Y dimensions are equal and that the Z dimension is of lower resolution than of X and Y. However, it does not assume equal spacing in the input image between all slices (sometimes common in CT and MR images). Note that since this class only adds images between slices it reduces to a 1D problem. For example, we only need the pixel above and below for linear interp since there isn't any change in X or change in Y.
    Version:
    0.1 Sept 14, 1998
    Author:
    Matthew J. McAuliffe, Ph.D.
    • Field Detail

      • CUBIC_BSPLINE

        public static final int CUBIC_BSPLINE
        Cubic b-spline interpolation mode.
        See Also:
        Constant Field Values
      • interpMode

        private int interpMode
        Interpolation mode (Linear, Cubic Bspline, Cubic Convolution).
    • Constructor Detail

      • AlgorithmReslice

        public AlgorithmReslice​(ModelImage srcImg,
                                int _interpMode)
        Creates new algorithm for reslicing to isotropic voxels.
        Parameters:
        srcImg - source image model
        _interpMode - interpolation mode supported by the class.
    • Method Detail

      • finalize

        public void finalize()
        Prepares this class for destruction.
        Overrides:
        finalize in class AlgorithmBase
      • getResultImage

        public ModelImage getResultImage()
        Accessor to get interpolated image.
        Returns:
        the interpolated image
      • calcRBSpline

        private float calcRBSpline​(float u)
        Reslice data is Cubic Bspline where.

        R(u) = 2/3 + 0.5*|u|^3 - u^2 for 0 <= |u| < 1

        R(u) = 1/6 * (2 - |u|)^3 for 1 <= |u| < 2

        Parameters:
        u - is the position to be interpolated
        Returns:
        DOCUMENT ME!
      • calcRCUBIC

        private float calcRCUBIC​(float u)
        Reslice using cubic convolution reslice where.

        R(u) = 3/2*|u|^3 - 5/2*u^2 + 1 for 0 <= |u| < 1

        R(u) = -1/2*|u|^3 + 5/2*u^2 - 4*|u| + 2 for 1 <= |u| <= 2

        Parameters:
        u - is the position to be interpolated
        Returns:
        the interpolated value
      • cubicReslice

        private void cubicReslice()
        Reslices the data into isotropic voxels using one of two interpolation methods (cubic Bspline or cubic convolution). Positions between the first and second image, and the last two images are interpolated using terminal slices in 2 of the buffers instead of only in 1 buffer because traditional usage of the interpolation function in these positions would exceed the bounds of the input data.
      • linearReslice

        private void linearReslice()
        Reslices the data into isotropic voxels using linear interpolation.