| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkFiniteCylinderSpatialFunction.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 __itkFiniteCylinderSpatialFunction_h |
| 18 |
|
#define __itkFiniteCylinderSpatialFunction_h |
| 19 |
|
|
| 20 |
|
#include "itkInteriorExteriorSpatialFunction.h" |
| 21 |
|
|
| 22 |
|
namespace itk |
| 23 |
|
{ |
| 24 |
|
|
| 25 |
|
/** |
| 26 |
|
* \class FiniteCylinderSpatialFunction |
| 27 |
|
* \brief Function implementation of an finite cylinder |
| 28 |
|
* |
| 29 |
|
* Implements a function that returns 1 for points inside or on the surface |
| 30 |
|
* of a cylinder and 0 for points outside the cylinder. |
| 31 |
|
* |
| 32 |
|
**/ |
| 33 |
|
|
| 34 |
|
template <unsigned int VDimension = 3, |
| 35 |
|
typename TInput = Point<double, VDimension> > |
| 36 |
|
class ITK_EXPORT FiniteCylinderSpatialFunction |
| 37 |
|
: public InteriorExteriorSpatialFunction<VDimension, TInput> |
| 38 |
|
{ |
| 39 |
|
public: |
| 40 |
|
|
| 41 |
|
/** Standard class typedefs. */ |
| 42 |
|
typedef FiniteCylinderSpatialFunction Self; |
| 43 |
TDA |
typedef InteriorExteriorSpatialFunction<VDimension, TInput> Superclass; |
| 44 |
TDA |
typedef SmartPointer<Self> Pointer; |
| 45 |
TDA |
typedef SmartPointer<const Self> ConstPointer; |
| 46 |
|
|
| 47 |
|
/** Run-time type information (and related methods). */ |
| 48 |
|
itkTypeMacro(FiniteCylinderSpatialFunction,InteriorExteriorSpatialFunction); |
| 49 |
|
|
| 50 |
|
/** Method for creation through the object factory. */ |
| 51 |
|
itkNewMacro(Self); |
| 52 |
|
|
| 53 |
|
/** Input type for the function */ |
| 54 |
|
typedef typename Superclass::InputType InputType; |
| 55 |
|
|
| 56 |
|
/** Output type for the function */ |
| 57 |
|
typedef typename Superclass::OutputType OutputType; |
| 58 |
|
|
| 59 |
|
/** Set/Get and set the center of the cylinder. */ |
| 60 |
|
itkGetMacro(Center, InputType); |
| 61 |
|
itkSetMacro(Center, InputType); |
| 62 |
|
|
| 63 |
|
/** Get and set the medial axis length of the cylinder. */ |
| 64 |
|
itkGetMacro(AxisLength, double); |
| 65 |
|
itkSetMacro(AxisLength, double); |
| 66 |
|
|
| 67 |
|
/** Get and set the radius length of the cylinder. */ |
| 68 |
|
itkGetMacro(Radius, double); |
| 69 |
|
itkSetMacro(Radius, double); |
| 70 |
|
|
| 71 |
|
/** Set the orientation vectors (must be orthogonal) of the ellipsoid axes. |
| 72 |
|
* Must be normalized!!!!! */ |
| 73 |
|
itkGetMacro(Orientation, InputType); |
| 74 |
|
itkSetMacro(Orientation, InputType); |
| 75 |
|
|
| 76 |
|
/** Evaluates the function at a given position. */ |
| 77 |
|
OutputType Evaluate(const InputType& position) const; |
| 78 |
|
|
| 79 |
|
protected: |
| 80 |
|
|
| 81 |
|
FiniteCylinderSpatialFunction(); |
| 82 |
|
virtual ~FiniteCylinderSpatialFunction(); |
| 83 |
|
|
| 84 |
|
void PrintSelf(std::ostream& os, Indent indent) const; |
| 85 |
|
|
| 86 |
|
private: |
| 87 |
|
|
| 88 |
|
FiniteCylinderSpatialFunction(const Self&); //purposely not implemented |
| 89 |
|
void operator=(const Self&); //purposely not implemented |
| 90 |
|
|
| 91 |
|
/** The center of the cylinder. */ |
| 92 |
|
InputType m_Center; |
| 93 |
|
|
| 94 |
|
/** The medial axis length of the cylinder. */ |
| 95 |
|
double m_AxisLength; |
| 96 |
|
|
| 97 |
|
/** The radius length of the cylinder. */ |
| 98 |
|
double m_Radius; |
| 99 |
|
|
| 100 |
|
/** The orientation vectors (must be orthogonal) of the ellipsoid axes. */ |
| 101 |
|
InputType m_Orientation; |
| 102 |
|
|
| 103 |
|
}; |
| 104 |
|
|
| 105 |
|
} // end namespace itk |
| 106 |
|
|
| 107 |
|
#ifndef ITK_MANUAL_INSTANTIATION |
| 108 |
|
#include "itkFiniteCylinderSpatialFunction.txx" |
| 109 |
|
#endif |
| 110 |
|
|
| 111 |
|
#endif |
| 112 |
|
|