Class AlgorithmReslice
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.utilities.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 Summary
Fields Modifier and Type Field Description static int
CUBIC
Cubic interpolation mode.static int
CUBIC_BSPLINE
Cubic b-spline interpolation mode.private int
interpMode
Interpolation mode (Linear, Cubic Bspline, Cubic Convolution).static int
LINEAR
Linear interpolation mode.-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmReslice(ModelImage srcImg, int _interpMode)
Creates new algorithm for reslicing to isotropic voxels.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private float
calcRBSpline(float u)
Reslice data is Cubic Bspline where.private float
calcRCUBIC(float u)
Reslice using cubic convolution reslice where.private void
cubicReslice()
Reslices the data into isotropic voxels using one of two interpolation methods (cubic Bspline or cubic convolution).void
finalize()
Prepares this class for destruction.ModelImage
getResultImage()
Accessor to get interpolated image.private void
linearReslice()
Reslices the data into isotropic voxels using linear interpolation.void
runAlgorithm()
Starts the program.-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
LINEAR
public static final int LINEAR
Linear interpolation mode.- See Also:
- Constant Field Values
-
CUBIC_BSPLINE
public static final int CUBIC_BSPLINE
Cubic b-spline interpolation mode.- See Also:
- Constant Field Values
-
CUBIC
public static final int CUBIC
Cubic 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 classAlgorithmBase
-
getResultImage
public ModelImage getResultImage()
Accessor to get interpolated image.- Returns:
- the interpolated image
-
runAlgorithm
public void runAlgorithm()
Starts the program.- Specified by:
runAlgorithm
in classAlgorithmBase
-
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.
-
-