Package gov.nih.mipav.model.structures
Class TalairachTransformInfo
java.lang.Object
gov.nih.mipav.model.structures.TalairachTransformInfo
- All Implemented Interfaces:
Serializable
This 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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final floatacpc constants.private static final floatacpc constants.private static final floatacpc constants.private static final floatacpc constants.private static final floatacpc constants.private WildMagic.LibFoundation.Mathematics.Vector3fAnterior Comissure in acpc space.private int[]Image dimensions.private WildMagic.LibFoundation.Mathematics.Vector3fACPC min and max extents of the brain.private WildMagic.LibFoundation.Mathematics.Vector3fACPC min and max extents of the brain.private WildMagic.LibFoundation.Mathematics.Vector3fPosterior Comissure in acpc space.private floatVoxel resolution (cubic).private booleanTrue if we have the data to compute orig invalid input: '<'-> acpc.private booleanTrue if we ahve the data to compute acpc invalid input: '<'-> tlrc.private WildMagic.LibFoundation.Mathematics.Vector3fAnterior Comissure in original space.private int[]Original image dimensions.private float[][]ACPC orientation in original image.private float[]Original image origin.private WildMagic.LibFoundation.Mathematics.Vector3fPosterior Comissure in original space.private float[]Original image voxel resolutions.private static final longUse serialVersionUID for interoperability.static final intacpc constants.static final intacpc constants.static final intacpc constants.static final intacpc constants. most inferior to AC.static final intacpc constants.static final intacpc constants.private WildMagic.LibFoundation.Mathematics.Vector3fAnterior Comissure in Talairach space.private int[]Image dimensions.private WildMagic.LibFoundation.Mathematics.Vector3fPosterior Comissure in Talairach space.private float[]Voxel resolutions for the sub-boxes.private booleanWhether to use the old, incorrect ACPC X dim calculation, which overcounted by one (used in backwards compatibility for Dr. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidacpcToOrig(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[][]For debug: return the transform as a 4x4 matrix.double[][]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.Vector3fGets anterior commissure in acpc space.int[]Gets acpc image dimensions.WildMagic.LibFoundation.Mathematics.Vector3fGets acpc max extent.WildMagic.LibFoundation.Mathematics.Vector3fGets acpc min extent.WildMagic.LibFoundation.Mathematics.Vector3fGets posterior comissure in acpc space.floatGets resolution in acpc space.WildMagic.LibFoundation.Mathematics.Vector3fGets anterior comissure in original space.int[]Gets original dims.intDetermines the image orienation in the forward direction...orig to acpc or acpc to tlrc.float[][]Gets the orienatations from original space.int[]When going from acpc to orig or tlrc to orig, this method is used to determine what he new axis orienations.float[]Gets original origin.WildMagic.LibFoundation.Mathematics.Vector3fGets posterior comissure in original space.float[]Gets resolution in original space.WildMagic.LibFoundation.Mathematics.Vector3fGets anterior comissure in tlrc space.int[]Gets dims in tlrc space.WildMagic.LibFoundation.Mathematics.Vector3fGets posterior comissure in tlrc space.float[]Gets resoltion in tlrc space.booleanisAcpc()Returns true if we have data to compute orig invalid input: '<'-> acpc.voidisAcpc(boolean flag) Sets isACPC flag.booleanisTlrc()returns true if we have data to compute acpc invalid input: '<'-> 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(String line, int nb) Parsing utility.private int[]parseIntParameters(String line, int nb) Parsing Parameters UtilityvoidreadFromFile(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(String filename) writes transform information to file
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
ACPC_LATERAL
private static final float ACPC_LATERALacpc constants. Lateral.- See Also:
-
ACPC_ANTERIOR
private static final float ACPC_ANTERIORacpc constants. Anterior.- See Also:
-
ACPC_POSTERIOR
private static final float ACPC_POSTERIORacpc constants. Posterior.- See Also:
-
ACPC_INFERIOR
private static final float ACPC_INFERIORacpc constants. Inferior.- See Also:
-
ACPC_SUPERIOR
private static final float ACPC_SUPERIORacpc constants. Superior.- See Also:
-
TLRC_AC_TO_PC
public static final int TLRC_AC_TO_PCacpc constants. AC to PC.- See Also:
-
TLRC_FRONT_TO_AC
public static final int TLRC_FRONT_TO_ACacpc constants. Most Anterior to AC.- See Also:
-
TLRC_PC_TO_BACK
public static final int TLRC_PC_TO_BACKacpc constants. PC to most posterior.- See Also:
-
TLRC_BOT_TO_AC
public static final int TLRC_BOT_TO_ACacpc constants. most inferior to AC.- See Also:
-
TLRC_AC_TO_TOP
public static final int TLRC_AC_TO_TOPacpc constants. AC to most superior.- See Also:
-
TLRC_AC_TO_LAT
public static final int TLRC_AC_TO_LATacpc constants. AC to left or right.- See Also:
-
acpcAC
private WildMagic.LibFoundation.Mathematics.Vector3f acpcACAnterior Comissure in acpc space. -
acpcDim
private int[] acpcDimImage dimensions. -
acpcMax
private WildMagic.LibFoundation.Mathematics.Vector3f acpcMaxACPC min and max extents of the brain. -
acpcMin
private WildMagic.LibFoundation.Mathematics.Vector3f acpcMinACPC min and max extents of the brain. -
acpcPC
private WildMagic.LibFoundation.Mathematics.Vector3f acpcPCPosterior Comissure in acpc space. -
acpcRes
private float acpcResVoxel resolution (cubic). -
isAcpc
private boolean isAcpcTrue if we have the data to compute orig invalid input: '<'-> acpc. -
isTlrc
private boolean isTlrcTrue if we ahve the data to compute acpc invalid input: '<'-> tlrc. -
origAC
private WildMagic.LibFoundation.Mathematics.Vector3f origACAnterior Comissure in original space. -
origDim
private int[] origDimOriginal image dimensions. -
origOrient
private float[][] origOrientACPC orientation in original image. -
origOrigin
private float[] origOriginOriginal image origin. -
origPC
private WildMagic.LibFoundation.Mathematics.Vector3f origPCPosterior Comissure in original space. -
origRes
private float[] origResOriginal image voxel resolutions. -
tlrcAC
private WildMagic.LibFoundation.Mathematics.Vector3f tlrcACAnterior Comissure in Talairach space. -
tlrcDim
private int[] tlrcDimImage dimensions. -
tlrcPC
private WildMagic.LibFoundation.Mathematics.Vector3f tlrcPCPosterior Comissure in Talairach space. -
tlrcRes
private float[] tlrcResVoxel resolutions for the sub-boxes. -
useIncorrectAcpcXDim
private boolean useIncorrectAcpcXDimWhether to use the old, incorrect ACPC X dim calculation, which overcounted by one (used in backwards compatibility for Dr. Pierpaoli's group).
-
-
Constructor Details
-
TalairachTransformInfo
public TalairachTransformInfo()Creates a new TalairachTransformInfo object.
-
-
Method Details
-
finalize
public void finalize()Prepares this class for cleanup. Calls thefinalizemethod for existing elements, closes any open files and sets other elements tonull. -
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 invalid input: '<'-> 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 invalid input: '<'-> 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
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
writes transform information to file- Parameters:
filename- name of transform info file
-
parseFloatParameters
Parsing utility.- Parameters:
line-nb-- Returns:
-
parseIntParameters
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).
-