KWStyle - itkEllipsoidInteriorExteriorSpatialFunction.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkEllipsoidInteriorExteriorSpatialFunction.h.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:35 $
7   Version:   $Revision: 1.4 $
8
9   Copyright (c) Insight Software Consortium. All rights reserved.
10   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11
12      This software is distributed WITHOUT ANY WARRANTY; without even 
13      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14      PURPOSE.  See the above copyright notices for more information.
15
16 =========================================================================*/
17 #ifndef __itkEllipsoidInteriorExteriorSpatialFunction_h
18 #define __itkEllipsoidInteriorExteriorSpatialFunction_h
19
20 #include "itkInteriorExteriorSpatialFunction.h"
21 #include "vnl/vnl_matrix_fixed.h"
22
23 namespace itk
24 {
25
26 /**
27  * \class EllipsoidSpatialFunction
28  * \brief Function implementation of an ellipsoid
29  *
30  * Implements a function that returns 1 for points inside or on the surface
31 LEN  * of a ellipsoid and 0 for points outside the ellipsoid. The orientation of the 
32  * n-dimensional ellipsoid axes are defined by n orthogonal vectors.
33  * See Examples/EllipsoidInteriorExteriorSpatialFunction/README for an example
34  * of creating an Ellipsoid in an image.
35  *
36  **/
37 template <unsigned int VDimension = 3,
38           typename TInput = Point<double, VDimension> >
39 class ITK_EXPORT EllipsoidInteriorExteriorSpatialFunction
40 : public InteriorExteriorSpatialFunction<VDimension, TInput>
41 {
42 public:
43   /** Standard class typedefs. */
44   typedef EllipsoidInteriorExteriorSpatialFunction Self;
45 TDA   typedef InteriorExteriorSpatialFunction<VDimension, TInput> Superclass;
46 TDA   typedef SmartPointer<Self>  Pointer;
47 TDA   typedef SmartPointer<const Self>  ConstPointer; 
48       
49   /** Run-time type information (and related methods). */
50 LEN   itkTypeMacro(EllipsoidInteriorExteriorSpatialFunction,InteriorExteriorSpatialFunction);
51
52   /** Method for creation through the object factory. */
53   itkNewMacro(Self);
54   
55   /** Input type for the function */
56   typedef typename Superclass::InputType InputType;
57
58   /** Output type for the function */
59   typedef typename Superclass::OutputType OutputType;
60
61   /** Typedef for the orientation matrix */
62   typedef vnl_matrix_fixed<double, VDimension, VDimension> OrientationType;
63    
64   /** Set/Get and set the center of the ellipsoid. */
65   itkGetMacro(Center, InputType);
66   itkSetMacro(Center, InputType);
67   
68   /** Get and set the axes lengths of the ellipsoid. */
69   itkGetMacro(Axes, InputType);
70   itkSetMacro(Axes, InputType);
71   
72   /** Set the orientation vectors (must be orthogonal) of the ellipsoid axes.
73    * Must be normalized!!!!! */
74   void SetOrientations(const OrientationType &);
75
76   /** Evaluates the function at a given position. */
77   OutputType Evaluate(const InputType& position) const;
78      
79 protected:
80   EllipsoidInteriorExteriorSpatialFunction();
81   virtual ~EllipsoidInteriorExteriorSpatialFunction();
82
83   void PrintSelf(std::ostream& os, Indent indent) const;
84
85 private:
86 LEN   EllipsoidInteriorExteriorSpatialFunction(const Self&); //purposely not implemented
87   void operator=(const Self&); //purposely not implemented
88
89   /** The center of the ellipsoid. */
90   InputType m_Center;
91
92   /** The axes lenths of the ellipsoid. */
93   InputType m_Axes;
94
95   /** The orientation vectors (must be orthogonal) of the ellipsoid axes. */  
96   double ** m_Orientations;
97 };
98
99 // end namespace itk
100
101 #ifndef ITK_MANUAL_INSTANTIATION
102 #include "itkEllipsoidInteriorExteriorSpatialFunction.txx"
103 #endif
104
105 #endif
106

Generated by KWStyle 1.0b on Tuesday January,17 at 02:14:06PM
© Kitware Inc.