Class TalairachTransformInfo

java.lang.Object
gov.nih.mipav.model.structures.TalairachTransformInfo
All Implemented Interfaces:
Serializable

public class TalairachTransformInfo extends Object implements 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

    Fields
    Modifier and Type
    Field
    Description
    private static final float
    acpc constants.
    private static final float
    acpc constants.
    private static final float
    acpc constants.
    private static final float
    acpc constants.
    private static final float
    acpc constants.
    private WildMagic.LibFoundation.Mathematics.Vector3f
    Anterior Comissure in acpc space.
    private int[]
    Image dimensions.
    private WildMagic.LibFoundation.Mathematics.Vector3f
    ACPC min and max extents of the brain.
    private WildMagic.LibFoundation.Mathematics.Vector3f
    ACPC min and max extents of the brain.
    private WildMagic.LibFoundation.Mathematics.Vector3f
    Posterior Comissure in acpc space.
    private float
    Voxel resolution (cubic).
    private boolean
    True if we have the data to compute orig invalid input: '<'-> acpc.
    private boolean
    True if we ahve the data to compute acpc invalid input: '<'-> tlrc.
    private WildMagic.LibFoundation.Mathematics.Vector3f
    Anterior 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.Vector3f
    Posterior Comissure in original space.
    private float[]
    Original image voxel resolutions.
    private static final long
    Use serialVersionUID for interoperability.
    static final int
    acpc constants.
    static final int
    acpc constants.
    static final int
    acpc constants.
    static final int
    acpc constants. most inferior to AC.
    static final int
    acpc constants.
    static final int
    acpc constants.
    private WildMagic.LibFoundation.Mathematics.Vector3f
    Anterior Comissure in Talairach space.
    private int[]
    Image dimensions.
    private WildMagic.LibFoundation.Mathematics.Vector3f
    Posterior Comissure in Talairach space.
    private float[]
    Voxel resolutions for the sub-boxes.
    private boolean
    Whether to use the old, incorrect ACPC X dim calculation, which overcounted by one (used in backwards compatibility for Dr.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new TalairachTransformInfo object.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    void
    acpcToOrig(WildMagic.LibFoundation.Mathematics.Vector3f pt, WildMagic.LibFoundation.Mathematics.Vector3f trans)
    Transforms point from acpc to orig...matrix is implicitly inverted in code.
    void
    acpcToTlrc(int x, int y, int z, WildMagic.LibFoundation.Mathematics.Vector3f trans)
    Transforms point from acpc to tlrc.
    void
    acpcToTlrc(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 MIPAV
    void
    Prepares this class for cleanup.
    WildMagic.LibFoundation.Mathematics.Vector3f
    Gets anterior commissure in acpc space.
    int[]
    Gets acpc image dimensions.
    WildMagic.LibFoundation.Mathematics.Vector3f
    Gets acpc max extent.
    WildMagic.LibFoundation.Mathematics.Vector3f
    Gets acpc min extent.
    WildMagic.LibFoundation.Mathematics.Vector3f
    Gets posterior comissure in acpc space.
    float
    Gets resolution in acpc space.
    WildMagic.LibFoundation.Mathematics.Vector3f
    Gets anterior comissure in original space.
    int[]
    Gets original dims.
    int
    Determines 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.Vector3f
    Gets posterior comissure in original space.
    float[]
    Gets resolution in original space.
    WildMagic.LibFoundation.Mathematics.Vector3f
    Gets anterior comissure in tlrc space.
    int[]
    Gets dims in tlrc space.
    WildMagic.LibFoundation.Mathematics.Vector3f
    Gets posterior comissure in tlrc space.
    float[]
    Gets resoltion in tlrc space.
    boolean
    Returns true if we have data to compute orig invalid input: '<'-> acpc.
    void
    isAcpc(boolean flag)
    Sets isACPC flag.
    boolean
    returns true if we have data to compute acpc invalid input: '<'-> tlrc.
    void
    isTlrc(boolean flag)
    Sets isTLRC flag.
    void
    origToAcpc(int x, int y, int z, WildMagic.LibFoundation.Mathematics.Vector3f trans)
    Transforms point from orig to acpc.
    void
    origToAcpc(WildMagic.LibFoundation.Mathematics.Vector3f pt, WildMagic.LibFoundation.Mathematics.Vector3f trans)
    Transforms point from orig to acpc.
    void
    origToTlrc(int x, int y, int z, WildMagic.LibFoundation.Mathematics.Vector3f trans)
    Transforms point from orig to tlrc.
    void
    origToTlrc(WildMagic.LibFoundation.Mathematics.Vector3f pt, WildMagic.LibFoundation.Mathematics.Vector3f trans)
    Transforms point from orig to tlrc.
    private float[]
    Parsing utility.
    private int[]
    parseIntParameters(String line, int nb)
    Parsing Parameters Utility
    void
    readFromFile(String filename)
    Reads transform info file
    void
    setAcpcMax(WildMagic.LibFoundation.Mathematics.Vector3f pt)
    Sets acpc max extent.
    void
    setAcpcMin(WildMagic.LibFoundation.Mathematics.Vector3f pt)
    Sets acpc min extent.
    void
    setAcpcPC(WildMagic.LibFoundation.Mathematics.Vector3f pt)
    Sets acpc posterior comissure.
    void
    setAcpcRes(float res)
    Sets acps resolution.
    void
    setOrigAC(WildMagic.LibFoundation.Mathematics.Vector3f pt)
    Sets the anterior comissure in original space.
    void
    setOrigDim(int[] dim)
    Sets dims in original space.
    void
    setOrigOrient(float[][] orient)
    Sets orienatationsin origianl space.
    void
    setOrigOrigin(float[] origin)
    Sets origin in original space.
    void
    setOrigPC(WildMagic.LibFoundation.Mathematics.Vector3f pt)
    Sets posterior comissure in original space.
    void
    setOrigRes(float[] res)
    Sets resolution in original space.
    void
    setTlrcRes(float[] res)
    Sets resolution in tlrc space
    void
    Sets whether the TalairachTransform acpcDim x value should be set up (incorrectly) like it was in previous versions (for Pierpaoli's group).
    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.
    void
    tlrcToAcpc(WildMagic.LibFoundation.Mathematics.Vector3f pt, WildMagic.LibFoundation.Mathematics.Vector3f trans)
    Transforms point from tlrc to acpc...matrix is implicitly inverted in code.
    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.
    void
    tlrcToOrig(WildMagic.LibFoundation.Mathematics.Vector3f pt, WildMagic.LibFoundation.Mathematics.Vector3f trans)
    Transforms point from tlrc to orig...matrix is implicitly inverted in code.
    void
    writeToFile(String filename)
    writes transform information to file

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • ACPC_LATERAL

      private static final float ACPC_LATERAL
      acpc constants. Lateral.
      See Also:
    • ACPC_ANTERIOR

      private static final float ACPC_ANTERIOR
      acpc constants. Anterior.
      See Also:
    • ACPC_POSTERIOR

      private static final float ACPC_POSTERIOR
      acpc constants. Posterior.
      See Also:
    • ACPC_INFERIOR

      private static final float ACPC_INFERIOR
      acpc constants. Inferior.
      See Also:
    • ACPC_SUPERIOR

      private static final float ACPC_SUPERIOR
      acpc constants. Superior.
      See Also:
    • TLRC_AC_TO_PC

      public static final int TLRC_AC_TO_PC
      acpc constants. AC to PC.
      See Also:
    • TLRC_FRONT_TO_AC

      public static final int TLRC_FRONT_TO_AC
      acpc constants. Most Anterior to AC.
      See Also:
    • TLRC_PC_TO_BACK

      public static final int TLRC_PC_TO_BACK
      acpc constants. PC to most posterior.
      See Also:
    • TLRC_BOT_TO_AC

      public static final int TLRC_BOT_TO_AC
      acpc constants. most inferior to AC.
      See Also:
    • TLRC_AC_TO_TOP

      public static final int TLRC_AC_TO_TOP
      acpc constants. AC to most superior.
      See Also:
    • TLRC_AC_TO_LAT

      public static final int TLRC_AC_TO_LAT
      acpc constants. AC to left or right.
      See Also:
    • 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 invalid input: '<'-> acpc.
    • isTlrc

      private boolean isTlrc
      True if we ahve the data to compute acpc invalid input: '<'-> 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).
  • Constructor Details

    • TalairachTransformInfo

      public TalairachTransformInfo()
      Creates a new TalairachTransformInfo object.
  • Method Details

    • finalize

      public void finalize()
      Prepares this class for cleanup. Calls the finalize method for existing elements, closes any open files and sets other elements to null.
      Overrides:
      finalize in class 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 point
      trans - 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 point
      trans - 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 point
      trans - 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 point
      trans - 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(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 point
      trans - 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 point
      trans - 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(String filename)
      writes transform information to file
      Parameters:
      filename - name of transform info file
    • parseFloatParameters

      private float[] parseFloatParameters(String line, int nb)
      Parsing utility.
      Parameters:
      line -
      nb -
      Returns:
    • parseIntParameters

      private int[] parseIntParameters(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).