Class TalairachTransformInfo

  • All Implemented Interfaces:
    java.io.Serializable

    public class TalairachTransformInfo
    extends java.lang.Object
    implements java.io.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:
    AlgorithmBase, TextRemoval, PlugInDialogTextRemoval, Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static float ACPC_ANTERIOR
      acpc constants.
      private static float ACPC_INFERIOR
      acpc constants.
      private static float ACPC_LATERAL
      acpc constants.
      private static float ACPC_POSTERIOR
      acpc constants.
      private static float ACPC_SUPERIOR
      acpc constants.
      private WildMagic.LibFoundation.Mathematics.Vector3f acpcAC
      Anterior Comissure in acpc space.
      private int[] acpcDim
      Image dimensions.
      private WildMagic.LibFoundation.Mathematics.Vector3f acpcMax
      ACPC min and max extents of the brain.
      private WildMagic.LibFoundation.Mathematics.Vector3f acpcMin
      ACPC min and max extents of the brain.
      private WildMagic.LibFoundation.Mathematics.Vector3f acpcPC
      Posterior Comissure in acpc space.
      private float acpcRes
      Voxel resolution (cubic).
      private boolean isAcpc
      True if we have the data to compute orig acpc.
      private boolean isTlrc
      True if we ahve the data to compute acpc tlrc.
      private WildMagic.LibFoundation.Mathematics.Vector3f origAC
      Anterior Comissure in original space.
      private int[] origDim
      Original image dimensions.
      private float[][] origOrient
      ACPC orientation in original image.
      private float[] origOrigin
      Original image origin.
      private WildMagic.LibFoundation.Mathematics.Vector3f origPC
      Posterior Comissure in original space.
      private float[] origRes
      Original image voxel resolutions.
      private static long serialVersionUID
      Use serialVersionUID for interoperability.
      static int TLRC_AC_TO_LAT
      acpc constants.
      static int TLRC_AC_TO_PC
      acpc constants.
      static int TLRC_AC_TO_TOP
      acpc constants.
      static int TLRC_BOT_TO_AC
      acpc constants. most inferior to AC.
      static int TLRC_FRONT_TO_AC
      acpc constants.
      static int TLRC_PC_TO_BACK
      acpc constants.
      private WildMagic.LibFoundation.Mathematics.Vector3f tlrcAC
      Anterior Comissure in Talairach space.
      private int[] tlrcDim
      Image dimensions.
      private WildMagic.LibFoundation.Mathematics.Vector3f tlrcPC
      Posterior Comissure in Talairach space.
      private float[] tlrcRes
      Voxel resolutions for the sub-boxes.
      private boolean useIncorrectAcpcXDim
      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
      TalairachTransformInfo()
      Creates a new TalairachTransformInfo object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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[][] 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 MIPAV
      void finalize()
      Prepares this class for cleanup.
      WildMagic.LibFoundation.Mathematics.Vector3f getAcpcAC()
      Gets anterior commissure in acpc space.
      int[] getAcpcDim()
      Gets acpc image dimensions.
      WildMagic.LibFoundation.Mathematics.Vector3f getAcpcMax()
      Gets acpc max extent.
      WildMagic.LibFoundation.Mathematics.Vector3f getAcpcMin()
      Gets acpc min extent.
      WildMagic.LibFoundation.Mathematics.Vector3f getAcpcPC()
      Gets posterior comissure in acpc space.
      float getAcpcRes()
      Gets resolution in acpc space.
      WildMagic.LibFoundation.Mathematics.Vector3f getOrigAC()
      Gets anterior comissure in original space.
      int[] getOrigDim()
      Gets original dims.
      int getOrigImageOrientLabel()
      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.Vector3f getOrigPC()
      Gets posterior comissure in original space.
      float[] getOrigRes()
      Gets resolution in original space.
      WildMagic.LibFoundation.Mathematics.Vector3f getTlrcAC()
      Gets anterior comissure in tlrc space.
      int[] getTlrcDim()
      Gets dims in tlrc space.
      WildMagic.LibFoundation.Mathematics.Vector3f getTlrcPC()
      Gets posterior comissure in tlrc space.
      float[] getTlrcRes()
      Gets resoltion in tlrc space.
      boolean isAcpc()
      Returns true if we have data to compute orig acpc.
      void isAcpc​(boolean flag)
      Sets isACPC flag.
      boolean isTlrc()
      returns true if we have data to compute acpc 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[] parseFloatParameters​(java.lang.String line, int nb)
      Parsing utility.
      private int[] parseIntParameters​(java.lang.String line, int nb)
      Parsing Parameters Utility
      void readFromFile​(java.lang.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 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).
      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​(java.lang.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 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).
    • Constructor Detail

      • TalairachTransformInfo

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

      • 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 java.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 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 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 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​(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 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​(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).