Class AlgorithmReslice
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.utilities.AlgorithmReslice
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intCubic interpolation mode.static final intCubic b-spline interpolation mode.private intInterpolation mode (Linear, Cubic Bspline, Cubic Convolution).static final intLinear 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, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionAlgorithmReslice(ModelImage srcImg, int _interpMode) Creates new algorithm for reslicing to isotropic voxels. -
Method Summary
Modifier and TypeMethodDescriptionprivate floatcalcRBSpline(float u) Reslice data is Cubic Bspline where.private floatcalcRCUBIC(float u) Reslice using cubic convolution reslice where.private voidReslices the data into isotropic voxels using one of two interpolation methods (cubic Bspline or cubic convolution).voidfinalize()Prepares this class for destruction.Accessor to get interpolated image.private voidReslices the data into isotropic voxels using linear interpolation.voidStarts 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, windowOpenedMethods 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, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
LINEAR
public static final int LINEARLinear interpolation mode.- See Also:
-
CUBIC_BSPLINE
public static final int CUBIC_BSPLINECubic b-spline interpolation mode.- See Also:
-
CUBIC
public static final int CUBICCubic interpolation mode.- See Also:
-
interpMode
private int interpModeInterpolation mode (Linear, Cubic Bspline, Cubic Convolution).
-
-
Constructor Details
-
AlgorithmReslice
Creates new algorithm for reslicing to isotropic voxels.- Parameters:
srcImg- source image model_interpMode- interpolation mode supported by the class.
-
-
Method Details
-
finalize
public void finalize()Prepares this class for destruction.- Overrides:
finalizein classAlgorithmBase
-
getResultImage
Accessor to get interpolated image.- Returns:
- the interpolated image
-
runAlgorithm
public void runAlgorithm()Starts the program.- Specified by:
runAlgorithmin 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 invalid input: '<'= |u| invalid input: '<' 1
R(u) = 1/6 * (2 - |u|)^3 for 1 invalid input: '<'= |u| invalid input: '<' 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 invalid input: '<'= |u| invalid input: '<' 1
R(u) = -1/2*|u|^3 + 5/2*u^2 - 4*|u| + 2 for 1 invalid input: '<'= |u| invalid input: '<'= 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.
-