Class CAAMTriangle


  • public class CAAMTriangle
    extends java.lang.Object
    This is the Java modified version of C++ active appearance model API (AAM_API). It is modified with a subset of required functions for automatic MRI prostate segmentation. AAM-API LICENSE - file: license.txt This software is freely available for non-commercial use such as research and education. Please see the full disclaimer below. All publications describing work using this software should cite the reference given below. Copyright (c) 2000-2003 Mikkel B. Stegmann, mbs@imm.dtu.dk IMM, Informatics & Mathematical Modelling DTU, Technical University of Denmark Richard Petersens Plads, Building 321 DK-2800 Lyngby, Denmark http://www.imm.dtu.dk/~aam/ REFERENCES Please use the reference below, when writing articles, reports etc. where the AAM-API has been used. A draft version the article is available from the homepage. I will be happy to receive pre- or reprints of such articles. /Mikkel ------------- M. B. Stegmann, B. K. Ersboll, R. Larsen, "FAME -- A Flexible Appearance Modelling Environment", IEEE Transactions on Medical Imaging, IEEE, 2003 (to appear) ------------- 3RD PART SOFTWARE The software is partly based on the following libraries: - The Microsoft(tm) Vision Software Developers Kit, VisSDK - LAPACK DISCLAIMER This software is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any non-commercial purpose, and to alter it, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. -- No guarantees of performance accompany this software, nor is any responsibility assumed on the part of the author or IMM. This software is provided by Mikkel B. Stegmann and IMM ``as is'' and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall IMM or Mikkel B. Stegmann be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. $Revision: 1.4 $ $Date: 2003/04/23 14:49:15 $ Triangle container with built-in hit test. This class is a simple triangle structure defined by three indexes to a list of points. Included functionality is a hit test.
    Author:
    Ruida Cheng
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double m_dD  
      java.util.Vector<CAAMPoint> m_pPoints
      The point vector from which the triangle is defined.
      private int m_v1
      Index to point 1.
      private int m_v2
      Index to point 2.
      private int m_v3
      Index to point 3.
    • Constructor Summary

      Constructors 
      Constructor Description
      CAAMTriangle()
      Constructor
      CAAMTriangle​(int _v1, int _v2, int _v3, java.util.Vector<CAAMPoint> pPoints)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double Area()
      Returns the area.
      void assign​(CAAMTriangle tri)
      Assignment operator
      void Calc_dD()
      Cache function.
      CAAMPoint CenterPoint()
      Returns the center point of the triangle.
      boolean IsInside​(CAAMPoint p)
      Returns true if the point 'p' is inside the triangle.
      boolean IsInside​(CAAMPoint p, double[] alpha, double[] beta, double[] gamma)
      Performs a hit test on the point p.
      int V1()
      Returns index to point 1.
      int V2()
      Returns index to point 2.
      int V3()
      Returns index to point 3.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • m_pPoints

        public java.util.Vector<CAAMPoint> m_pPoints
        The point vector from which the triangle is defined.
      • m_v1

        private int m_v1
        Index to point 1.
      • m_v2

        private int m_v2
        Index to point 2.
      • m_v3

        private int m_v3
        Index to point 3.
      • m_dD

        private double m_dD
    • Constructor Detail

      • CAAMTriangle

        public CAAMTriangle​(int _v1,
                            int _v2,
                            int _v3,
                            java.util.Vector<CAAMPoint> pPoints)
        Constructor
        Parameters:
        _v1 - first point index
        _v2 - second point index
        _v3 - third point index
        pPoints - point vector for triangle
      • CAAMTriangle

        public CAAMTriangle()
        Constructor
    • Method Detail

      • assign

        public void assign​(CAAMTriangle tri)
        Assignment operator
        Parameters:
        tri - triangle reference.
      • Calc_dD

        public void Calc_dD()
        Cache function.
      • IsInside

        public boolean IsInside​(CAAMPoint p)
        Returns true if the point 'p' is inside the triangle.
        Parameters:
        p - The point to test
        Returns:
        True if the point is inside, otherwise false.
      • IsInside

        public boolean IsInside​(CAAMPoint p,
                                double[] alpha,
                                double[] beta,
                                double[] gamma)
        Performs a hit test on the point p. If p is inside -- the position of p relative to the triangle is returned. The relative position is: p = alpha*p1 + beta*p2 + gamma*p3 Where p1-3 is the three points of the triangle.
        Parameters:
        p - The point to test alpha Relative x1 position. beta Relative x2 position. gamma Relative x3 position.
        Returns:
        True if the point is inside, otherwise false.
      • CenterPoint

        public CAAMPoint CenterPoint()
        Returns the center point of the triangle.
        Returns:
        center point
      • Area

        public double Area()
        Returns the area.
        Returns:
        The area.
      • V1

        public int V1()
        Returns index to point 1.
        Returns:
        index 1
      • V2

        public int V2()
        Returns index to point 2.
        Returns:
        index 2
      • V3

        public int V3()
        Returns index to point 3.
        Returns:
        index 3