Class AlgorithmRegBSpline25D
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.registration.AlgorithmRegBSpline
-
- gov.nih.mipav.model.algorithms.registration.AlgorithmRegBSpline25D
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmRegBSpline25D extends AlgorithmRegBSpline
BSpline based registration of 2.5D images.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gov.nih.mipav.model.algorithms.registration.AlgorithmRegBSpline
AlgorithmRegBSpline.Options
-
-
Field Summary
Fields Modifier and Type Field Description protected int
m_iSliceTarget
Index of the slice in the input source image to use as the target.-
Fields inherited from class gov.nih.mipav.model.algorithms.registration.AlgorithmRegBSpline
m_kImageDeformation, m_kImageResult, m_kImageSource, m_kImageTarget, m_kOptionsPass1, m_kOptionsPass2, m_kRegMeasure
-
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 AlgorithmRegBSpline25D(ModelImage kImageResult, ModelImage kImageSource, int iSliceTarget, ModelImage kImageDeformation, RegistrationMeasure kRegMeasure, AlgorithmRegBSpline.Options kOptionsPass1, AlgorithmRegBSpline.Options kOptionsPass2)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disposeLocal()
Prepares this class for destruction.void
finalize()
Override of Object method called by garbage collection.void
runAlgorithm()
AlgorithmBase abstract method implementation which performs the registration.protected BSplineRegistration2Df
runPass(ModelSimpleImage kSource, ModelSimpleImage kTarget, AlgorithmRegBSpline.Options kOptions, BSplineRegistration2Df kRegPrev)
Perform a "pass" of BSpline based registration.private void
transform2DVOI(ModelImage image, ModelImage destImage, float[] imgBuffer, float[] kImageMapX, float[] kImageMapY, int iSlice, int iNumSlices)
private void
writeResults(BSplineRegistration2Df[] akReg)
Save the registration information to a file.-
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
-
-
-
-
Constructor Detail
-
AlgorithmRegBSpline25D
public AlgorithmRegBSpline25D(ModelImage kImageResult, ModelImage kImageSource, int iSliceTarget, ModelImage kImageDeformation, RegistrationMeasure kRegMeasure, AlgorithmRegBSpline.Options kOptionsPass1, AlgorithmRegBSpline.Options kOptionsPass2)
Constructor.- Parameters:
kImageResult
- ModelImage Reference to an image to store the registered source image. This image must have the same dimensions as the input source image.kImageSource
- ModelImage Reference to the original input image to use as the registration source.iSliceTarget
- int Index of the slice in the input source image that is to be used as the reference. If this index is -1, then each slice is registered to the one before itkImageDeformation
- ModelImage Reference to an image to store the computed deformation. This may be a null reference to indicate that the deformation is not to be computed. If this reference is not null, then the image must have the same dimensions as the input source image.kRegMeasure
- RegistrationMeasure Reference to the particular cost measure to use for this registration. The cost measure is the same for all passes.kOptionsPass1
- Options Options to use for a first pass of registration. This may *not* be a null reference.kOptionsPass2
- Options Options to use for a second pass of registration. This may be null to indicate that only a single pass of registration is to be performed.
-
-
Method Detail
-
disposeLocal
public void disposeLocal()
Prepares this class for destruction.- Overrides:
disposeLocal
in classAlgorithmRegBSpline
-
finalize
public void finalize()
Override of Object method called by garbage collection.- Overrides:
finalize
in classAlgorithmRegBSpline
-
runAlgorithm
public void runAlgorithm()
AlgorithmBase abstract method implementation which performs the registration.- Specified by:
runAlgorithm
in classAlgorithmBase
- Throws:
java.lang.RuntimeException
- DOCUMENT ME!
-
transform2DVOI
private void transform2DVOI(ModelImage image, ModelImage destImage, float[] imgBuffer, float[] kImageMapX, float[] kImageMapY, int iSlice, int iNumSlices)
-
runPass
protected BSplineRegistration2Df runPass(ModelSimpleImage kSource, ModelSimpleImage kTarget, AlgorithmRegBSpline.Options kOptions, BSplineRegistration2Df kRegPrev)
Perform a "pass" of BSpline based registration. A "pass" is defined to be one or more iterations using the BSpline basis parameters, gradient descent parameters, and convergence parameters.- Parameters:
kSource
- ModelSimpleImage Reference to the original input image to use as the registration source. This image does not have to have the same dimensions as the image to be used as the registration target.kTarget
- ModelSimpleImage Reference to the original input image to use as the registration target.kOptions
- Options Options to use for a this registration pass. This may *not* be a null reference.kRegPrev
- BSplineRegistration2Df Reference to a previous registration which can be used to initialize this registration. This may be a null reference meaning that the this registration uses the default "identity" initialization. If this it not a null reference, then this registration is initialized to provide the a close approximation to the same BSpline mapping as determined by the input registration. The main property of a registration is the position of its control points.- Returns:
- BSplineRegistration2Df Registration instance resulting from this pass. This may be needed to provide for the initialization of subsequent passes or to compute the deformation image.
-
writeResults
private void writeResults(BSplineRegistration2Df[] akReg)
Save the registration information to a file. This information includes the BSpline parameters; in particular, the coordinates for the lattice of control points.- Parameters:
akReg
- BSplineRegistration2Df[] Contains the parameters which define the BSpline for registering each slice of the source image to the particular reference slice.
-
-