| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkFrustumSpatialFunction.h.html,v $ |
| 5 |
|
Language: C++ |
| 6 |
|
Date: $Date: 2006/01/17 19:15:36 $ |
| 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 __itkFrustumSpatialFunction_h |
| 18 |
|
#define __itkFrustumSpatialFunction_h |
| 19 |
|
|
| 20 |
|
#include "itkInteriorExteriorSpatialFunction.h" |
| 21 |
|
|
| 22 |
|
namespace itk |
| 23 |
|
{ |
| 24 |
|
|
| 25 |
|
/** |
| 26 |
|
* \class FrustumSpatialFunction |
| 27 |
|
* \brief Spatial function implementation of a truncated pyramid. |
| 28 |
|
* |
| 29 |
|
* Implements a function that returns 0 for points inside or on the surface |
| 30 |
|
* of a truncated pyrami, 1 for points outside the truncated pyramid |
| 31 |
|
* |
| 32 |
|
* \ingroup SpatialFunctions |
| 33 |
|
* |
| 34 |
|
* */ |
| 35 |
|
|
| 36 |
|
template <unsigned int VImageDimension=3,typename TInput=Point<double,3> > |
| 37 |
|
class ITK_EXPORT FrustumSpatialFunction : |
| 38 |
IND |
************public InteriorExteriorSpatialFunction<VImageDimension,TInput> |
| 39 |
|
{ |
| 40 |
|
public: |
| 41 |
|
|
| 42 |
|
/** Standard class typedefs. */ |
| 43 |
|
typedef FrustumSpatialFunction<VImageDimension,TInput> Self; |
| 44 |
TDA |
typedef InteriorExteriorSpatialFunction<VImageDimension,TInput> Superclass; |
| 45 |
TDA |
typedef SmartPointer<Self> Pointer; |
| 46 |
TDA |
typedef SmartPointer<const Self> ConstPointer; |
| 47 |
|
|
| 48 |
|
/** Run-time type information (and related methods). */ |
| 49 |
|
itkTypeMacro(FrustumSpatialFunction,InteriorExteriorSpatialFunction); |
| 50 |
|
|
| 51 |
|
/** Method for creation through the object factory. */ |
| 52 |
|
itkNewMacro(Self); |
| 53 |
|
|
| 54 |
|
/** Input type for the function */ |
| 55 |
|
typedef typename Superclass::InputType InputType; |
| 56 |
|
|
| 57 |
|
/** Output type for the function */ |
| 58 |
|
typedef typename Superclass::OutputType OutputType; |
| 59 |
|
|
| 60 |
|
/** Rotate the frustum in the XZ or the YZ plane */ |
| 61 |
|
typedef enum{ |
| 62 |
|
RotateInXZPlane=1, |
| 63 |
|
RotateInYZPlane |
| 64 |
IND |
**} FrustumRotationPlaneType; |
| 65 |
|
|
| 66 |
|
/** Evaluates the function at a given position */ |
| 67 |
|
OutputType Evaluate(const InputType& position) const; |
| 68 |
|
|
| 69 |
|
/** Get and set the center of the sphere */ |
| 70 |
|
itkGetMacro( Apex, InputType); |
| 71 |
|
itkSetMacro( Apex, InputType); |
| 72 |
|
|
| 73 |
|
/** Get and set the angle of the pyramid axis |
| 74 |
|
* with respect to the Z axis */ |
| 75 |
|
itkGetMacro( AngleZ, double); |
| 76 |
|
itkSetMacro( AngleZ, double); |
| 77 |
|
|
| 78 |
|
/** Get and set the aperture angle in X */ |
| 79 |
|
itkGetMacro( ApertureAngleX, double); |
| 80 |
|
itkSetMacro( ApertureAngleX, double); |
| 81 |
|
|
| 82 |
|
/** Get and set the aperture angle in Y */ |
| 83 |
|
itkGetMacro( ApertureAngleY, double); |
| 84 |
|
itkSetMacro( ApertureAngleY, double); |
| 85 |
|
|
| 86 |
|
/** Get and set the top plane distance to the Apex */ |
| 87 |
|
itkGetMacro( TopPlane, double); |
| 88 |
|
itkSetMacro( TopPlane, double); |
| 89 |
|
|
| 90 |
|
/** Get and set the bottom plane distance to the Apex */ |
| 91 |
|
itkGetMacro( BottomPlane, double); |
| 92 |
|
itkSetMacro( BottomPlane, double); |
| 93 |
|
|
| 94 |
IND |
*/** Set macro to set the plane in which the frustum should rotate */ |
| 95 |
|
itkSetMacro( RotationPlane, FrustumRotationPlaneType ); |
| 96 |
|
|
| 97 |
|
protected: |
| 98 |
|
FrustumSpatialFunction(); |
| 99 |
|
virtual ~FrustumSpatialFunction(); |
| 100 |
|
void PrintSelf(std::ostream& os, Indent indent) const; |
| 101 |
|
|
| 102 |
|
private: |
| 103 |
|
FrustumSpatialFunction(const Self&); //purposely not implemented |
| 104 |
|
void operator=(const Self&); //purposely not implemented |
| 105 |
|
|
| 106 |
|
/** The apex of the pyramid (of the same type as Input) */ |
| 107 |
|
InputType m_Apex; |
| 108 |
|
|
| 109 |
|
/** Angle between the pyramid axis and the Z axis */ |
| 110 |
|
double m_AngleZ; |
| 111 |
|
|
| 112 |
|
/** Aperture Angle in X direction */ |
| 113 |
|
double m_ApertureAngleX; |
| 114 |
|
|
| 115 |
|
/** Aperture Angle in Y direction */ |
| 116 |
|
double m_ApertureAngleY; |
| 117 |
|
|
| 118 |
|
/** Distance from Apex to top plane */ |
| 119 |
|
double m_TopPlane; |
| 120 |
|
|
| 121 |
|
/** Distance from Apex to bottom plane */ |
| 122 |
|
double m_BottomPlane; |
| 123 |
|
|
| 124 |
|
/** Plane in which to the frustum is being rotated */ |
| 125 |
|
FrustumRotationPlaneType m_RotationPlane; |
| 126 |
|
|
| 127 |
|
}; |
| 128 |
|
|
| 129 |
|
} // end namespace itk |
| 130 |
|
|
| 131 |
|
#ifndef ITK_MANUAL_INSTANTIATION |
| 132 |
|
#include "itkFrustumSpatialFunction.txx" |
| 133 |
|
#endif |
| 134 |
|
|
| 135 |
|
#endif |
| 136 |
|
|
| 137 |
EOF |
|
| 138 |
EOF,EML |
|
| 139 |
EOF,EML |
|
| 140 |
EOF,EML |
|