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 TransMatrixalignmentXfrmDOCUMENT ME!private int[]axisDirADOCUMENT ME!private int[]axisDirBDOCUMENT ME!private double[]coordADOCUMENT ME!private double[]coordBDOCUMENT ME!private double[]dimBprivate double dimA[], resA[];.private booleandoMatchDOCUMENT ME!private ModelImageimageADOCUMENT ME!private ModelImageimageBDOCUMENT ME!private int[]index2AxialDOCUMENT ME!private int[]index2ImgADOCUMENT ME!(package private) java.lang.StringnameDOCUMENT ME!private TransMatrixorientADOCUMENT ME!private TransMatrixorientA_invDOCUMENT ME!private TransMatrixorientBDOCUMENT ME!private TransMatrixorientB_invDOCUMENT ME!private ModelImageorientedImgBDOCUMENT ME!private double[][]orientMatrixADOCUMENT ME!private double[][]orientMatrixBDOCUMENT ME!private double[]resBprivate double dimA[], resA[];.private ModelImageresultImgDOCUMENT ME!private ModelImageshiftedImgBDOCUMENT ME!private int[]sign2AxialDOCUMENT ME!private int[]sign2ImgADOCUMENT ME!private double[]xOrientADOCUMENT ME!private double[]xOrientBDOCUMENT ME!private double[]yOrientADOCUMENT ME!private double[]yOrientBDOCUMENT ME!private double[]zOrientADOCUMENT ME!private double[]zOrientBDOCUMENT 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 voidfinalize()Prepares this class for destruction.private voidgetIndices()Get indices for reordering data from Image B to the Axial coordinate system (LPS) and to the coordinate system of Image A.voidgetPatientOrientation(double[] xOrient, double[] yOrient, ModelImage image)Extract orientation info from file header.voidgetPatientPosition(double[] coord, ModelImage image)Extracts the origin from image file info.ModelImagegetResultImage()Accessor that returns the result image.private voidgetTransform()Get transformation matrix from Image B to Image A.private voidmatchOrigin()Add image margins to image B, or crop to match Image A.private voidreOrient()Reorient ImageB so that directions will coincide with ImageA.voidrunAlgorithm()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:
finalizein 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:
runAlgorithmin 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.
-
-