Package gov.nih.mipav.model.structures
Class TalairachTransformInfo
- java.lang.Object
-
- gov.nih.mipav.model.structures.TalairachTransformInfo
-
- All Implemented Interfaces:
java.io.Serializable
public class TalairachTransformInfo extends java.lang.Object implements java.io.SerializableThis is the structure to store information needed to compute ACPC and Talairach normalization.If you have any questions, please drop me a line. ===== Pilou Bazin MEDIC, JHU pbazin1@jhmi.edu
- Version:
- July 26, 2004
- Author:
- Pierre-Louis Bazin
- See Also:
AlgorithmBase,TextRemoval,PlugInDialogTextRemoval, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static floatACPC_ANTERIORacpc constants.private static floatACPC_INFERIORacpc constants.private static floatACPC_LATERALacpc constants.private static floatACPC_POSTERIORacpc constants.private static floatACPC_SUPERIORacpc constants.private WildMagic.LibFoundation.Mathematics.Vector3facpcACAnterior Comissure in acpc space.private int[]acpcDimImage dimensions.private WildMagic.LibFoundation.Mathematics.Vector3facpcMaxACPC min and max extents of the brain.private WildMagic.LibFoundation.Mathematics.Vector3facpcMinACPC min and max extents of the brain.private WildMagic.LibFoundation.Mathematics.Vector3facpcPCPosterior Comissure in acpc space.private floatacpcResVoxel resolution (cubic).private booleanisAcpcTrue if we have the data to compute orig <-> acpc.private booleanisTlrcTrue if we ahve the data to compute acpc <-> tlrc.private WildMagic.LibFoundation.Mathematics.Vector3forigACAnterior Comissure in original space.private int[]origDimOriginal image dimensions.private float[][]origOrientACPC orientation in original image.private float[]origOriginOriginal image origin.private WildMagic.LibFoundation.Mathematics.Vector3forigPCPosterior Comissure in original space.private float[]origResOriginal image voxel resolutions.private static longserialVersionUIDUse serialVersionUID for interoperability.static intTLRC_AC_TO_LATacpc constants.static intTLRC_AC_TO_PCacpc constants.static intTLRC_AC_TO_TOPacpc constants.static intTLRC_BOT_TO_ACacpc constants. most inferior to AC.static intTLRC_FRONT_TO_ACacpc constants.static intTLRC_PC_TO_BACKacpc constants.private WildMagic.LibFoundation.Mathematics.Vector3ftlrcACAnterior Comissure in Talairach space.private int[]tlrcDimImage dimensions.private WildMagic.LibFoundation.Mathematics.Vector3ftlrcPCPosterior Comissure in Talairach space.private float[]tlrcResVoxel resolutions for the sub-boxes.private booleanuseIncorrectAcpcXDimWhether to use the old, incorrect ACPC X dim calculation, which overcounted by one (used in backwards compatibility for Dr.
-
Constructor Summary
Constructors Constructor Description TalairachTransformInfo()Creates a new TalairachTransformInfo object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacpcToOrig(int x, int y, int z, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from acpc to orig...matrix is implicitly inverted in code.voidacpcToOrig(WildMagic.LibFoundation.Mathematics.Vector3f pt, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from acpc to orig...matrix is implicitly inverted in code.voidacpcToTlrc(int x, int y, int z, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from acpc to tlrc.voidacpcToTlrc(WildMagic.LibFoundation.Mathematics.Vector3f pt, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from acpc to tlrc.double[][]displayAcpc()For debug: return the transform as a 4x4 matrix.double[][]displayAcpcInverse()For debug: return the transform inverse as a 4x4 matrix.double[][]displayTlrc(int id)Unknown use and currently not being referenced within MIPAVvoidfinalize()Prepares this class for cleanup.WildMagic.LibFoundation.Mathematics.Vector3fgetAcpcAC()Gets anterior commissure in acpc space.int[]getAcpcDim()Gets acpc image dimensions.WildMagic.LibFoundation.Mathematics.Vector3fgetAcpcMax()Gets acpc max extent.WildMagic.LibFoundation.Mathematics.Vector3fgetAcpcMin()Gets acpc min extent.WildMagic.LibFoundation.Mathematics.Vector3fgetAcpcPC()Gets posterior comissure in acpc space.floatgetAcpcRes()Gets resolution in acpc space.WildMagic.LibFoundation.Mathematics.Vector3fgetOrigAC()Gets anterior comissure in original space.int[]getOrigDim()Gets original dims.intgetOrigImageOrientLabel()Determines the image orienation in the forward direction...orig to acpc or acpc to tlrc.float[][]getOrigOrient()Gets the orienatations from original space.int[]getOrigOrientLabelsInverse()When going from acpc to orig or tlrc to orig, this method is used to determine what he new axis orienations.float[]getOrigOrigin()Gets original origin.WildMagic.LibFoundation.Mathematics.Vector3fgetOrigPC()Gets posterior comissure in original space.float[]getOrigRes()Gets resolution in original space.WildMagic.LibFoundation.Mathematics.Vector3fgetTlrcAC()Gets anterior comissure in tlrc space.int[]getTlrcDim()Gets dims in tlrc space.WildMagic.LibFoundation.Mathematics.Vector3fgetTlrcPC()Gets posterior comissure in tlrc space.float[]getTlrcRes()Gets resoltion in tlrc space.booleanisAcpc()Returns true if we have data to compute orig <-> acpc.voidisAcpc(boolean flag)Sets isACPC flag.booleanisTlrc()returns true if we have data to compute acpc <-> tlrc.voidisTlrc(boolean flag)Sets isTLRC flag.voidorigToAcpc(int x, int y, int z, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from orig to acpc.voidorigToAcpc(WildMagic.LibFoundation.Mathematics.Vector3f pt, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from orig to acpc.voidorigToTlrc(int x, int y, int z, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from orig to tlrc.voidorigToTlrc(WildMagic.LibFoundation.Mathematics.Vector3f pt, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from orig to tlrc.private float[]parseFloatParameters(java.lang.String line, int nb)Parsing utility.private int[]parseIntParameters(java.lang.String line, int nb)Parsing Parameters UtilityvoidreadFromFile(java.lang.String filename)Reads transform info filevoidsetAcpcMax(WildMagic.LibFoundation.Mathematics.Vector3f pt)Sets acpc max extent.voidsetAcpcMin(WildMagic.LibFoundation.Mathematics.Vector3f pt)Sets acpc min extent.voidsetAcpcPC(WildMagic.LibFoundation.Mathematics.Vector3f pt)Sets acpc posterior comissure.voidsetAcpcRes(float res)Sets acps resolution.voidsetOrigAC(WildMagic.LibFoundation.Mathematics.Vector3f pt)Sets the anterior comissure in original space.voidsetOrigDim(int[] dim)Sets dims in original space.voidsetOrigOrient(float[][] orient)Sets orienatationsin origianl space.voidsetOrigOrigin(float[] origin)Sets origin in original space.voidsetOrigPC(WildMagic.LibFoundation.Mathematics.Vector3f pt)Sets posterior comissure in original space.voidsetOrigRes(float[] res)Sets resolution in original space.voidsetTlrcRes(float[] res)Sets resolution in tlrc spacevoidsetUseIncorrectAcpcXDim(boolean flag)Sets whether the TalairachTransform acpcDim x value should be set up (incorrectly) like it was in previous versions (for Pierpaoli's group).voidtlrcToAcpc(int x, int y, int z, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from tlrc to acpc...matrix is implicitly inverted in code.voidtlrcToAcpc(WildMagic.LibFoundation.Mathematics.Vector3f pt, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from tlrc to acpc...matrix is implicitly inverted in code.voidtlrcToOrig(int x, int y, int z, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from tlrc to orig...matrix is implicitly inverted in code.voidtlrcToOrig(WildMagic.LibFoundation.Mathematics.Vector3f pt, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from tlrc to orig...matrix is implicitly inverted in code.voidwriteToFile(java.lang.String filename)writes transform information to file
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
ACPC_LATERAL
private static final float ACPC_LATERAL
acpc constants. Lateral.- See Also:
- Constant Field Values
-
ACPC_ANTERIOR
private static final float ACPC_ANTERIOR
acpc constants. Anterior.- See Also:
- Constant Field Values
-
ACPC_POSTERIOR
private static final float ACPC_POSTERIOR
acpc constants. Posterior.- See Also:
- Constant Field Values
-
ACPC_INFERIOR
private static final float ACPC_INFERIOR
acpc constants. Inferior.- See Also:
- Constant Field Values
-
ACPC_SUPERIOR
private static final float ACPC_SUPERIOR
acpc constants. Superior.- See Also:
- Constant Field Values
-
TLRC_AC_TO_PC
public static final int TLRC_AC_TO_PC
acpc constants. AC to PC.- See Also:
- Constant Field Values
-
TLRC_FRONT_TO_AC
public static final int TLRC_FRONT_TO_AC
acpc constants. Most Anterior to AC.- See Also:
- Constant Field Values
-
TLRC_PC_TO_BACK
public static final int TLRC_PC_TO_BACK
acpc constants. PC to most posterior.- See Also:
- Constant Field Values
-
TLRC_BOT_TO_AC
public static final int TLRC_BOT_TO_AC
acpc constants. most inferior to AC.- See Also:
- Constant Field Values
-
TLRC_AC_TO_TOP
public static final int TLRC_AC_TO_TOP
acpc constants. AC to most superior.- See Also:
- Constant Field Values
-
TLRC_AC_TO_LAT
public static final int TLRC_AC_TO_LAT
acpc constants. AC to left or right.- See Also:
- Constant Field Values
-
acpcAC
private WildMagic.LibFoundation.Mathematics.Vector3f acpcAC
Anterior Comissure in acpc space.
-
acpcDim
private int[] acpcDim
Image dimensions.
-
acpcMax
private WildMagic.LibFoundation.Mathematics.Vector3f acpcMax
ACPC min and max extents of the brain.
-
acpcMin
private WildMagic.LibFoundation.Mathematics.Vector3f acpcMin
ACPC min and max extents of the brain.
-
acpcPC
private WildMagic.LibFoundation.Mathematics.Vector3f acpcPC
Posterior Comissure in acpc space.
-
acpcRes
private float acpcRes
Voxel resolution (cubic).
-
isAcpc
private boolean isAcpc
True if we have the data to compute orig <-> acpc.
-
isTlrc
private boolean isTlrc
True if we ahve the data to compute acpc <-> tlrc.
-
origAC
private WildMagic.LibFoundation.Mathematics.Vector3f origAC
Anterior Comissure in original space.
-
origDim
private int[] origDim
Original image dimensions.
-
origOrient
private float[][] origOrient
ACPC orientation in original image.
-
origOrigin
private float[] origOrigin
Original image origin.
-
origPC
private WildMagic.LibFoundation.Mathematics.Vector3f origPC
Posterior Comissure in original space.
-
origRes
private float[] origRes
Original image voxel resolutions.
-
tlrcAC
private WildMagic.LibFoundation.Mathematics.Vector3f tlrcAC
Anterior Comissure in Talairach space.
-
tlrcDim
private int[] tlrcDim
Image dimensions.
-
tlrcPC
private WildMagic.LibFoundation.Mathematics.Vector3f tlrcPC
Posterior Comissure in Talairach space.
-
tlrcRes
private float[] tlrcRes
Voxel resolutions for the sub-boxes.
-
useIncorrectAcpcXDim
private boolean useIncorrectAcpcXDim
Whether to use the old, incorrect ACPC X dim calculation, which overcounted by one (used in backwards compatibility for Dr. Pierpaoli's group).
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for cleanup. Calls thefinalizemethod for existing elements, closes any open files and sets other elements tonull.- Overrides:
finalizein classjava.lang.Object
-
acpcToOrig
public void acpcToOrig(WildMagic.LibFoundation.Mathematics.Vector3f pt, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from acpc to orig...matrix is implicitly inverted in code.- Parameters:
pt- old pointtrans- new point
-
acpcToOrig
public void acpcToOrig(int x, int y, int z, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from acpc to orig...matrix is implicitly inverted in code.- Parameters:
x-y-z-trans- new point
-
acpcToTlrc
public void acpcToTlrc(WildMagic.LibFoundation.Mathematics.Vector3f pt, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from acpc to tlrc.- Parameters:
pt- old pointtrans- new point
-
acpcToTlrc
public void acpcToTlrc(int x, int y, int z, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from acpc to tlrc.- Parameters:
x-y-z-trans- new point
-
displayAcpc
public double[][] displayAcpc()
For debug: return the transform as a 4x4 matrix.- Returns:
- 4*4 matrix
-
displayAcpcInverse
public double[][] displayAcpcInverse()
For debug: return the transform inverse as a 4x4 matrix.- Returns:
- 4*4 matrix
-
displayTlrc
public double[][] displayTlrc(int id)
Unknown use and currently not being referenced within MIPAV
-
getAcpcAC
public WildMagic.LibFoundation.Mathematics.Vector3f getAcpcAC()
Gets anterior commissure in acpc space.- Returns:
- acpcAC
-
getAcpcDim
public int[] getAcpcDim()
Gets acpc image dimensions.- Returns:
- acpcDim
-
getAcpcMax
public WildMagic.LibFoundation.Mathematics.Vector3f getAcpcMax()
Gets acpc max extent.- Returns:
- acpcMax
-
getAcpcMin
public WildMagic.LibFoundation.Mathematics.Vector3f getAcpcMin()
Gets acpc min extent.- Returns:
- acpcMin
-
getAcpcPC
public WildMagic.LibFoundation.Mathematics.Vector3f getAcpcPC()
Gets posterior comissure in acpc space.- Returns:
- acpcPC
-
getAcpcRes
public float getAcpcRes()
Gets resolution in acpc space.- Returns:
- acpcRes
-
getOrigAC
public WildMagic.LibFoundation.Mathematics.Vector3f getOrigAC()
Gets anterior comissure in original space.- Returns:
- origAC
-
getOrigDim
public int[] getOrigDim()
Gets original dims.- Returns:
- origDim
-
getOrigOrigin
public float[] getOrigOrigin()
Gets original origin.- Returns:
- origOrigin
-
getOrigImageOrientLabel
public int getOrigImageOrientLabel()
Determines the image orienation in the forward direction...orig to acpc or acpc to tlrc.- Returns:
- image orientation
-
getOrigOrient
public float[][] getOrigOrient()
Gets the orienatations from original space.- Returns:
- origOrient
-
getOrigOrientLabelsInverse
public int[] getOrigOrientLabelsInverse()
When going from acpc to orig or tlrc to orig, this method is used to determine what he new axis orienations. It uses an inverted matrix for determination.- Returns:
- orientations
-
getOrigPC
public WildMagic.LibFoundation.Mathematics.Vector3f getOrigPC()
Gets posterior comissure in original space.- Returns:
- orgiPC
-
getOrigRes
public float[] getOrigRes()
Gets resolution in original space.- Returns:
- orgiRes
-
getTlrcAC
public WildMagic.LibFoundation.Mathematics.Vector3f getTlrcAC()
Gets anterior comissure in tlrc space.- Returns:
- tlrcAC
-
getTlrcDim
public int[] getTlrcDim()
Gets dims in tlrc space.- Returns:
- tlrcDim
-
getTlrcPC
public WildMagic.LibFoundation.Mathematics.Vector3f getTlrcPC()
Gets posterior comissure in tlrc space.- Returns:
- tlrcPC
-
getTlrcRes
public float[] getTlrcRes()
Gets resoltion in tlrc space.- Returns:
- tlrcRes
-
isAcpc
public boolean isAcpc()
Returns true if we have data to compute orig <-> acpc.- Returns:
- isAcpc
-
isAcpc
public void isAcpc(boolean flag)
Sets isACPC flag.- Parameters:
boolean- flag
-
isTlrc
public boolean isTlrc()
returns true if we have data to compute acpc <-> tlrc.- Returns:
- isTlrc
-
isTlrc
public void isTlrc(boolean flag)
Sets isTLRC flag.- Parameters:
boolean- flag
-
origToAcpc
public void origToAcpc(WildMagic.LibFoundation.Mathematics.Vector3f pt, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from orig to acpc.- Parameters:
pt- old pointtrans- new point
-
origToAcpc
public void origToAcpc(int x, int y, int z, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from orig to acpc.- Parameters:
x-y-z-trans- new point
-
origToTlrc
public void origToTlrc(WildMagic.LibFoundation.Mathematics.Vector3f pt, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from orig to tlrc.- Parameters:
pt- old pointtrans- new point
-
origToTlrc
public void origToTlrc(int x, int y, int z, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from orig to tlrc.- Parameters:
x-y-z-trans- new point
-
readFromFile
public void readFromFile(java.lang.String filename)
Reads transform info file- Parameters:
filename- name of transform info file
-
setAcpcMax
public void setAcpcMax(WildMagic.LibFoundation.Mathematics.Vector3f pt)
Sets acpc max extent.- Parameters:
Vector3f- pt
-
setAcpcMin
public void setAcpcMin(WildMagic.LibFoundation.Mathematics.Vector3f pt)
Sets acpc min extent.- Parameters:
Vector3f- pt
-
setAcpcPC
public void setAcpcPC(WildMagic.LibFoundation.Mathematics.Vector3f pt)
Sets acpc posterior comissure.- Parameters:
Vector3f- pt
-
setAcpcRes
public void setAcpcRes(float res)
Sets acps resolution.- Parameters:
float- res
-
setOrigAC
public void setOrigAC(WildMagic.LibFoundation.Mathematics.Vector3f pt)
Sets the anterior comissure in original space.- Parameters:
Vector3f- point
-
setOrigDim
public void setOrigDim(int[] dim)
Sets dims in original space.- Parameters:
int- [] dim
-
setOrigOrigin
public void setOrigOrigin(float[] origin)
Sets origin in original space.- Parameters:
origin-
-
setOrigOrient
public void setOrigOrient(float[][] orient)
Sets orienatationsin origianl space.- Parameters:
float- [][] orient
-
setOrigPC
public void setOrigPC(WildMagic.LibFoundation.Mathematics.Vector3f pt)
Sets posterior comissure in original space.- Parameters:
Vector3f- point
-
setOrigRes
public void setOrigRes(float[] res)
Sets resolution in original space.- Parameters:
float- [] res
-
setTlrcRes
public void setTlrcRes(float[] res)
Sets resolution in tlrc space- Parameters:
float- [] res
-
tlrcToAcpc
public void tlrcToAcpc(WildMagic.LibFoundation.Mathematics.Vector3f pt, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from tlrc to acpc...matrix is implicitly inverted in code.- Parameters:
pt- old pointtrans- new point
-
tlrcToAcpc
public void tlrcToAcpc(int x, int y, int z, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from tlrc to acpc...matrix is implicitly inverted in code.- Parameters:
x-y-z-trans- new point
-
tlrcToOrig
public void tlrcToOrig(WildMagic.LibFoundation.Mathematics.Vector3f pt, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from tlrc to orig...matrix is implicitly inverted in code.- Parameters:
pt- old pointtrans- new point
-
tlrcToOrig
public void tlrcToOrig(int x, int y, int z, WildMagic.LibFoundation.Mathematics.Vector3f trans)Transforms point from tlrc to orig...matrix is implicitly inverted in code.- Parameters:
x-y-z-trans- new point
-
writeToFile
public void writeToFile(java.lang.String filename)
writes transform information to file- Parameters:
filename- name of transform info file
-
parseFloatParameters
private float[] parseFloatParameters(java.lang.String line, int nb)Parsing utility.- Parameters:
line-nb-- Returns:
-
parseIntParameters
private int[] parseIntParameters(java.lang.String line, int nb)Parsing Parameters Utility- Parameters:
line-nb-- Returns:
-
setUseIncorrectAcpcXDim
public void setUseIncorrectAcpcXDim(boolean flag)
Sets whether the TalairachTransform acpcDim x value should be set up (incorrectly) like it was in previous versions (for Pierpaoli's group).- Parameters:
flag- True if the old, incorrect x acpcDim value should be used (which overcounts by one).
-
-