Class AlgorithmRegPatientPos
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.registration.AlgorithmRegPatientPos
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmRegPatientPos extends AlgorithmBase
Use origin and image orientations to align images based on patient position.- Version:
- 1.0 Sept 2000
- Author:
- Delia McGarry, Zohara Cohen
-
-
Field Summary
Fields Modifier and Type Field Description private TransMatrix
alignmentXfrm
DOCUMENT ME!private int[]
axisDirA
DOCUMENT ME!private int[]
axisDirB
DOCUMENT ME!private double[]
coordA
DOCUMENT ME!private double[]
coordB
DOCUMENT ME!private double[]
dimB
private double dimA[], resA[];.private boolean
doMatch
DOCUMENT ME!private ModelImage
imageA
DOCUMENT ME!private ModelImage
imageB
DOCUMENT ME!private int[]
index2Axial
DOCUMENT ME!private int[]
index2ImgA
DOCUMENT ME!(package private) java.lang.String
name
DOCUMENT ME!private TransMatrix
orientA
DOCUMENT ME!private TransMatrix
orientA_inv
DOCUMENT ME!private TransMatrix
orientB
DOCUMENT ME!private TransMatrix
orientB_inv
DOCUMENT ME!private ModelImage
orientedImgB
DOCUMENT ME!private double[][]
orientMatrixA
DOCUMENT ME!private double[][]
orientMatrixB
DOCUMENT ME!private double[]
resB
private double dimA[], resA[];.private ModelImage
resultImg
DOCUMENT ME!private ModelImage
shiftedImgB
DOCUMENT ME!private int[]
sign2Axial
DOCUMENT ME!private int[]
sign2ImgA
DOCUMENT ME!private double[]
xOrientA
DOCUMENT ME!private double[]
xOrientB
DOCUMENT ME!private double[]
yOrientA
DOCUMENT ME!private double[]
yOrientB
DOCUMENT ME!private double[]
zOrientA
DOCUMENT ME!private double[]
zOrientB
DOCUMENT ME!-
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 AlgorithmRegPatientPos(ModelImage imageA, ModelImage imageB, boolean doMatch)
Creates new algorithm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finalize()
Prepares this class for destruction.private void
getIndices()
Get indices for reordering data from Image B to the Axial coordinate system (LPS) and to the coordinate system of Image A.void
getPatientOrientation(double[] xOrient, double[] yOrient, ModelImage image)
Extract orientation info from file header.void
getPatientPosition(double[] coord, ModelImage image)
Extracts the origin from image file info.ModelImage
getResultImage()
Accessor that returns the result image.private void
getTransform()
Get transformation matrix from Image B to Image A.private void
matchOrigin()
Add image margins to image B, or crop to match Image A.private void
reOrient()
Reorient ImageB so that directions will coincide with ImageA.void
runAlgorithm()
Starts the program.(package private) double[]
vectorCrossProduct(double[] a, double[] b)
Returns orgthogonal vector.-
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
-
name
java.lang.String name
DOCUMENT ME!
-
alignmentXfrm
private TransMatrix alignmentXfrm
DOCUMENT ME!
-
axisDirA
private int[] axisDirA
DOCUMENT ME!
-
axisDirB
private int[] axisDirB
DOCUMENT ME!
-
coordA
private double[] coordA
DOCUMENT ME!
-
coordB
private double[] coordB
DOCUMENT ME!
-
dimB
private double[] dimB
private double dimA[], resA[];.
-
resB
private double[] resB
private double dimA[], resA[];.
-
doMatch
private boolean doMatch
DOCUMENT ME!
-
imageA
private ModelImage imageA
DOCUMENT ME!
-
imageB
private ModelImage imageB
DOCUMENT ME!
-
orientedImgB
private ModelImage orientedImgB
DOCUMENT ME!
-
shiftedImgB
private ModelImage shiftedImgB
DOCUMENT ME!
-
resultImg
private ModelImage resultImg
DOCUMENT ME!
-
index2Axial
private int[] index2Axial
DOCUMENT ME!
-
index2ImgA
private int[] index2ImgA
DOCUMENT ME!
-
sign2Axial
private int[] sign2Axial
DOCUMENT ME!
-
sign2ImgA
private int[] sign2ImgA
DOCUMENT ME!
-
orientA
private TransMatrix orientA
DOCUMENT ME!
-
orientB
private TransMatrix orientB
DOCUMENT ME!
-
orientA_inv
private TransMatrix orientA_inv
DOCUMENT ME!
-
orientB_inv
private TransMatrix orientB_inv
DOCUMENT ME!
-
orientMatrixA
private double[][] orientMatrixA
DOCUMENT ME!
-
orientMatrixB
private double[][] orientMatrixB
DOCUMENT ME!
-
xOrientA
private double[] xOrientA
DOCUMENT ME!
-
yOrientA
private double[] yOrientA
DOCUMENT ME!
-
zOrientA
private double[] zOrientA
DOCUMENT ME!
-
xOrientB
private double[] xOrientB
DOCUMENT ME!
-
yOrientB
private double[] yOrientB
DOCUMENT ME!
-
zOrientB
private double[] zOrientB
DOCUMENT ME!
-
-
Constructor Detail
-
AlgorithmRegPatientPos
public AlgorithmRegPatientPos(ModelImage imageA, ModelImage imageB, boolean doMatch)
Creates new algorithm.- Parameters:
imageA
- image AimageB
- image B, to be registered to imageAdoMatch
- whether to match the image origins
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
getPatientOrientation
public void getPatientOrientation(double[] xOrient, double[] yOrient, ModelImage image)
Extract orientation info from file header.- Parameters:
xOrient
- 3D array of directional cosines in xyOrient
- 3D array of directional cosines in yimage
- image
-
getPatientPosition
public void getPatientPosition(double[] coord, ModelImage image)
Extracts the origin from image file info.- Parameters:
coord
- 3D array of patient position x,y,z *image
- image
-
getResultImage
public ModelImage getResultImage()
Accessor that returns the result image.- Returns:
- result image
-
runAlgorithm
public void runAlgorithm()
Starts the program.- Specified by:
runAlgorithm
in classAlgorithmBase
-
vectorCrossProduct
double[] vectorCrossProduct(double[] a, double[] b)
Returns orgthogonal vector.- Parameters:
a
- vectorb
- vector- Returns:
- vector orthogonal to a & b
-
getIndices
private void getIndices()
Get indices for reordering data from Image B to the Axial coordinate system (LPS) and to the coordinate system of Image A.
-
getTransform
private void getTransform()
Get transformation matrix from Image B to Image A.
-
matchOrigin
private void matchOrigin()
Add image margins to image B, or crop to match Image A.
-
reOrient
private void reOrient()
Reorient ImageB so that directions will coincide with ImageA.
-
-