Package gov.nih.mipav.model.algorithms
Class AlgorithmMidsagittal
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmMidsagittal
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmMidsagittal extends AlgorithmBase
Finds the midsagittal line of a brain MRI by:- Flipping the image horizontally.
- Registering the flipped image against the original.
- Getting the angle that the registration rotated the image.
- Transforming the original image by half the registration rotation.
- Version:
- 0.1 Dec 29, 2004
- Author:
- Evan McCreedy
-
-
Field Summary
Fields Modifier and Type Field Description private int
baseNumIter
Limits the number of iterations of Powell's algorithm when registering the original image against the flipped image.private int
coarseAngle
The coarse angle step to use in each dimension when registering the original image against the flipped image.private int
costFunc
The cost function to use when registering the original image against the flipped image.private int
dof
The number of degrees of freedom to use when registering the original image against the flipped image.private boolean
doMultiThread
private boolean
doSubsample
Whether to use subsampling when registering the original image against the flipped image.private boolean
fastMode
Whether to skip searching of the parameter space when registering the original image against the flipped image.private int
fineAngle
The fine angle step to use in each dimension when registering the original image against the flipped image.private int
interp
The interpolation method to use when registering the original image against the flipped image.private boolean
maxOfMin
Whether to use the maximum of the minimum resolutions of the 2 images when respampling during registration against the flipped image.private int
numMinima
Number of minima from level 8 to test at level 4 when registering the original image against the flipped image.private int
searchAngle
The search angles to use in each dimension (from-searchAngle
tosearchAngle
) when registering the original image against the flipped image.-
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 AlgorithmMidsagittal(ModelImage srcImg)
Construct the midsagittal algorithm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
calc()
Find the midsagittal line and transform the source image to align it along that line vertically.private void
calc35D()
void
finalize()
Prepares this class for destruction.ModelImage
getResultImage()
Get the midsagittal aligned image.void
runAlgorithm()
Starts the algorithm.-
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
-
baseNumIter
private int baseNumIter
Limits the number of iterations of Powell's algorithm when registering the original image against the flipped image.
-
coarseAngle
private int coarseAngle
The coarse angle step to use in each dimension when registering the original image against the flipped image.
-
costFunc
private int costFunc
The cost function to use when registering the original image against the flipped image.
-
dof
private int dof
The number of degrees of freedom to use when registering the original image against the flipped image.
-
doSubsample
private boolean doSubsample
Whether to use subsampling when registering the original image against the flipped image.
-
doMultiThread
private boolean doMultiThread
-
fastMode
private boolean fastMode
Whether to skip searching of the parameter space when registering the original image against the flipped image.
-
fineAngle
private int fineAngle
The fine angle step to use in each dimension when registering the original image against the flipped image.
-
interp
private int interp
The interpolation method to use when registering the original image against the flipped image.
-
maxOfMin
private boolean maxOfMin
Whether to use the maximum of the minimum resolutions of the 2 images when respampling during registration against the flipped image.
-
numMinima
private int numMinima
Number of minima from level 8 to test at level 4 when registering the original image against the flipped image.
-
searchAngle
private int searchAngle
The search angles to use in each dimension (from-searchAngle
tosearchAngle
) when registering the original image against the flipped image.
-
-
Constructor Detail
-
AlgorithmMidsagittal
public AlgorithmMidsagittal(ModelImage srcImg)
Construct the midsagittal algorithm.- Parameters:
srcImg
- source image model
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
getResultImage
public ModelImage getResultImage()
Get the midsagittal aligned image.- Returns:
- the aligned image
-
runAlgorithm
public void runAlgorithm()
Starts the algorithm.- Specified by:
runAlgorithm
in classAlgorithmBase
-
calc
private void calc()
Find the midsagittal line and transform the source image to align it along that line vertically.
-
calc35D
private void calc35D()
-
-