Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itk::Point< TCoordRep, NPointDimension > Class Template Reference
[Geometry Representation ObjectsData Representation Objects]

A templated class holding a geometric point in n-Dimensional space. More...

#include <itkPoint.h>

Inheritance diagram for itk::Point< TCoordRep, NPointDimension >:

Inheritance graph
[legend]
Collaboration diagram for itk::Point< TCoordRep, NPointDimension >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef Point Self
typedef FixedArray< TCoordRep,
NPointDimension > 
Superclass
typedef TCoordRep ValueType
typedef TCoordRep CoordRepType
typedef FixedArray< TCoordRep,
NPointDimension > 
BaseArray
typedef BaseArray::Iterator Iterator
typedef BaseArray::ConstIterator ConstIterator
typedef Vector< ValueType,
NPointDimension > 
VectorType

Public Member Functions

 itkStaticConstMacro (PointDimension, unsigned int, NPointDimension)
 Point ()
const Selfoperator+= (const VectorType &vec)
const Selfoperator-= (const VectorType &vec)
VectorType operator- (const Self &pnt) const
Self operator+ (const VectorType &vec) const
Self operator- (const VectorType &vec) const
VectorType GetVectorFromOrigin () const
TCoordRep EuclideanDistanceTo (const Self &) const
TCoordRep SquaredEuclideanDistanceTo (const Self &) const
vnl_vector_ref< TCoordRep > Get_vnl_vector (void)
void SetToMidPoint (const Self &, const Self &)
 Point (const Self &r)
 Point (const ValueType r[PointDimension])
Pointoperator= (const Self &r)
Pointoperator= (const ValueType r[PointDimension])
bool operator== (const Self &pt) const
bool operator!= (const Self &pt) const
void SetToBarycentricCombination (const Self &A, const Self &B, double alpha)
void SetToBarycentricCombination (const Self &A, const Self &B, const Self &C, double weightA, double weightB)
void SetToBarycentricCombination (const Self *P, const double *weights, unsigned int N)
template<typename TCoordRepB> void CastFrom (const Point< TCoordRepB, NPointDimension > &pa)

Static Public Member Functions

unsigned int GetPointDimension ()

Detailed Description

template<class TCoordRep, unsigned int NPointDimension = 3>
class itk::Point< TCoordRep, NPointDimension >

A templated class holding a geometric point in n-Dimensional space.

Point is a templated class that holds a set of coordinates (components). Point can be used as the data type held at each pixel in an Image or at each vertex of an Mesh. The template parameter T can be any data type that behaves like a primitive (or atomic) data type (int, short, float, complex). The NPointDimension defines the number of components in the point array.

See also:
Image

Mesh

Vector

CovariantVector

Matrix

Definition at line 42 of file itkPoint.h.


Member Typedef Documentation

template<class TCoordRep, unsigned int NPointDimension = 3>
typedef FixedArray<TCoordRep, NPointDimension> itk::Point< TCoordRep, NPointDimension >::BaseArray
 

The Array type from which this Vector is derived.

Reimplemented in itk::ContinuousIndex< TCoordRep, VIndexDimension >.

Definition at line 58 of file itkPoint.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
typedef BaseArray::ConstIterator itk::Point< TCoordRep, NPointDimension >::ConstIterator
 

A const iterator through the array.

Reimplemented from itk::FixedArray< TCoordRep, NPointDimension >.

Reimplemented in itk::ContinuousIndex< TCoordRep, VIndexDimension >.

Definition at line 60 of file itkPoint.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
typedef TCoordRep itk::Point< TCoordRep, NPointDimension >::CoordRepType
 

Reimplemented in itk::ContinuousIndex< TCoordRep, VIndexDimension >.

Definition at line 52 of file itkPoint.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
typedef BaseArray::Iterator itk::Point< TCoordRep, NPointDimension >::Iterator
 

An iterator through the array.

Reimplemented from itk::FixedArray< TCoordRep, NPointDimension >.

Reimplemented in itk::ContinuousIndex< TCoordRep, VIndexDimension >.

Definition at line 59 of file itkPoint.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
typedef Point itk::Point< TCoordRep, NPointDimension >::Self
 

Standard class typedefs.

Reimplemented in itk::ContinuousIndex< TCoordRep, VIndexDimension >.

Definition at line 46 of file itkPoint.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
typedef FixedArray<TCoordRep,NPointDimension> itk::Point< TCoordRep, NPointDimension >::Superclass
 

Reimplemented in itk::ContinuousIndex< TCoordRep, VIndexDimension >.

Definition at line 47 of file itkPoint.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
typedef TCoordRep itk::Point< TCoordRep, NPointDimension >::ValueType
 

ValueType can be used to declare a variable that is the same type as a data element held in an Point.

Reimplemented from itk::FixedArray< TCoordRep, NPointDimension >.

Reimplemented in itk::ContinuousIndex< TCoordRep, VIndexDimension >.

Definition at line 51 of file itkPoint.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
typedef Vector< ValueType, NPointDimension > itk::Point< TCoordRep, NPointDimension >::VectorType
 

VectorType define the difference between two Points Definition at line 67 of file itkPoint.h.


Constructor & Destructor Documentation

template<class TCoordRep, unsigned int NPointDimension = 3>
itk::Point< TCoordRep, NPointDimension >::Point  )  [inline]
 

Default constructor has nothing to do. Definition at line 70 of file itkPoint.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
itk::Point< TCoordRep, NPointDimension >::Point const Self r  )  [inline]
 

Pass-through constructor for the Array base class. Definition at line 73 of file itkPoint.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
itk::Point< TCoordRep, NPointDimension >::Point const ValueType  r[PointDimension]  )  [inline]
 

Pass-through constructor for the Array base class. Definition at line 74 of file itkPoint.h.


Member Function Documentation

template<class TCoordRep, unsigned int NPointDimension = 3>
template<typename TCoordRepB>
void itk::Point< TCoordRep, NPointDimension >::CastFrom const Point< TCoordRepB, NPointDimension > &  pa  )  [inline]
 

Copy from another Point with a different representation type. Casting is done with C-Like rules Definition at line 209 of file itkPoint.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
TCoordRep itk::Point< TCoordRep, NPointDimension >::EuclideanDistanceTo const Self  )  const
 

Returns Euclidean distance between two points

template<class TCoordRep, unsigned int NPointDimension = 3>
vnl_vector_ref<TCoordRep> itk::Point< TCoordRep, NPointDimension >::Get_vnl_vector void   ) 
 

Get a vnl_vector_ref referencing the same memory block

template<class TCoordRep, unsigned int NPointDimension = 3>
unsigned int itk::Point< TCoordRep, NPointDimension >::GetPointDimension  )  [inline, static]
 

Get the dimension (size) of the point. Definition at line 63 of file itkPoint.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
VectorType itk::Point< TCoordRep, NPointDimension >::GetVectorFromOrigin  )  const
 

Access an element of a point. This version can be used as an lvalue.

template<class TCoordRep, unsigned int NPointDimension = 3>
itk::Point< TCoordRep, NPointDimension >::itkStaticConstMacro PointDimension  ,
unsigned  int,
NPointDimension 
 

Dimension of the Space

template<class TCoordRep, unsigned int NPointDimension = 3>
bool itk::Point< TCoordRep, NPointDimension >::operator!= const Self pt  )  const [inline]
 

Compare two points for inequality. Definition at line 95 of file itkPoint.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
Self itk::Point< TCoordRep, NPointDimension >::operator+ const VectorType vec  )  const
 

Add a vector to a point. Return a new point.

template<class TCoordRep, unsigned int NPointDimension = 3>
const Self& itk::Point< TCoordRep, NPointDimension >::operator+= const VectorType vec  ) 
 

Point operator+=. Adds a vector to the current point.

template<class TCoordRep, unsigned int NPointDimension = 3>
Self itk::Point< TCoordRep, NPointDimension >::operator- const VectorType vec  )  const
 

Subtract a vector from a point. Return a new point.

template<class TCoordRep, unsigned int NPointDimension = 3>
VectorType itk::Point< TCoordRep, NPointDimension >::operator- const Self pnt  )  const
 

Computes the Vector difference between two points

template<class TCoordRep, unsigned int NPointDimension = 3>
const Self& itk::Point< TCoordRep, NPointDimension >::operator-= const VectorType vec  ) 
 

Point operator-=. Subtracts a vector from a current point.

template<class TCoordRep, unsigned int NPointDimension = 3>
Point& itk::Point< TCoordRep, NPointDimension >::operator= const ValueType  r[PointDimension]  ) 
 

Pass-through assignment operator for the Array base class.

template<class TCoordRep, unsigned int NPointDimension = 3>
Point& itk::Point< TCoordRep, NPointDimension >::operator= const Self r  ) 
 

Pass-through assignment operator for the Array base class.

template<class TCoordRep, unsigned int NPointDimension = 3>
bool itk::Point< TCoordRep, NPointDimension >::operator== const Self pt  )  const [inline]
 

Compare two points for equality. Definition at line 84 of file itkPoint.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
void itk::Point< TCoordRep, NPointDimension >::SetToBarycentricCombination const Self P,
const double *  weights,
unsigned int  N
 

Set the current point to a barycentric combination of an array of N points An array of (N-1) values is expected to weight the contribution of the first (N-1) points, the weight of the Nth point is computed to ensure that the N weights sum 1.

This method computes:

\[ \overrightarrow{P}= \sum_{i=1}^{N-1} w_i * \overrightarrow{P}_i + \left(1- \sum_{i=1}^{N-1} w_i\right) * \overrightarrow{P}_N \]

template<class TCoordRep, unsigned int NPointDimension = 3>
void itk::Point< TCoordRep, NPointDimension >::SetToBarycentricCombination const Self A,
const Self B,
const Self C,
double  weightA,
double  weightB
 

Set the current point to a barycentric combination of three points Two values are expected to weight the contribution of the first two points, the weight of for the third point is computed to ensure that the three weights sum 1.

This method computes:

\[ \overrightarrow{P}= w_1 * \overrightarrow{P}_1 + w_2 * \overrightarrow{P}_2 + (1-w_1-w_2 ) * \overrightarrow{P}_3 \]

If the two weight are $ \in [0,1] $ , The resulting point will alway be placed inside the triangle formed by the three points given as arguments.

template<class TCoordRep, unsigned int NPointDimension = 3>
void itk::Point< TCoordRep, NPointDimension >::SetToBarycentricCombination const Self A,
const Self B,
double  alpha
 

Set the current point to a barycentric combination of the two points given as arguments.

Parameters:
\form#126 = weight for the first point
The first point is multiplied by $ \alpha $, the second is multiplied by * $ (1-\alpha) $, and the sum is stored in the Point on which the method is invoked.

\[ \overrightarrow{P}=\alpha * \overrightarrow{A}+ (1-\alpha)*\overrightarrow{B} \]

If the value of $ \alpha \in [0,1] $, the resulting point will be placed in the line segment $ \overline{AB} $ joining $ \overrightarrow{A} $ and $ \overrightarrow{A} $

If the value of $ \alpha < 0 $ the resulting point will be placed outside the line segment $ \overline{AB} $ on the side of $ \overrightarrow{A} $.

If the value of $ \alpha > 1 $ the resulting point will be placed outside the line segment $ \overline{AB} $ on the side of $ \overrightarrow{B} $.

See also:
SetToMedian

template<class TCoordRep, unsigned int NPointDimension = 3>
void itk::Point< TCoordRep, NPointDimension >::SetToMidPoint const Self ,
const Self
 

Set to median point between the two points given as arguments

This method computes:

\[ \overrightarrow{P}=\frac{(\overrightarrow{A}+\overrightarrow{B})}{2} \]

using the two Points given as arguments, and store the result in the Point on which the method is invoked.

template<class TCoordRep, unsigned int NPointDimension = 3>
TCoordRep itk::Point< TCoordRep, NPointDimension >::SquaredEuclideanDistanceTo const Self  )  const
 

Returns Squared Euclidean distance between two points


The documentation for this class was generated from the following file:
Generated at Sun Apr 1 03:12:32 2007 for ITK by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2000