ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkFiniteCylinderSpatialFunction.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkFiniteCylinderSpatialFunction_h
00019 #define __itkFiniteCylinderSpatialFunction_h
00020 
00021 #include "itkInteriorExteriorSpatialFunction.h"
00022 #include "itkConceptChecking.h"
00023 
00024 namespace itk
00025 {
00038 template< unsigned int VDimension = 3,
00039           typename TInput = Point< double, VDimension > >
00040 class ITK_EXPORT FiniteCylinderSpatialFunction:
00041   public InteriorExteriorSpatialFunction< VDimension, TInput >
00042 {
00043 public:
00044 
00046   typedef FiniteCylinderSpatialFunction                         Self;
00047   typedef InteriorExteriorSpatialFunction< VDimension, TInput > Superclass;
00048   typedef SmartPointer< Self >                                  Pointer;
00049   typedef SmartPointer< const Self >                            ConstPointer;
00050 
00052   itkTypeMacro(FiniteCylinderSpatialFunction, InteriorExteriorSpatialFunction);
00053 
00055   itkNewMacro(Self);
00056 
00058   typedef typename Superclass::InputType InputType;
00059 
00061   typedef typename Superclass::OutputType OutputType;
00062 
00064   itkGetConstMacro(Center, InputType);
00065   itkSetMacro(Center, InputType);
00067 
00069   itkGetConstMacro(AxisLength, double);
00070   itkSetMacro(AxisLength, double);
00072 
00074   itkGetConstMacro(Radius, double);
00075   itkSetMacro(Radius, double);
00077 
00080   itkGetConstMacro(Orientation, InputType);
00081   itkSetMacro(Orientation, InputType);
00083 
00085   OutputType Evaluate(const InputType & position) const;
00086 
00087 #ifdef ITK_USE_CONCEPT_CHECKING
00088 
00089   itkConceptMacro( DimensionShouldBe3,
00090                    ( Concept::SameDimension< VDimension, 3u > ) );
00091   itkConceptMacro( PointDimensionShouldBe3,
00092                    ( Concept::SameDimension< InputType::Dimension, 3u > ) );
00093 
00095 #endif
00096 
00097 protected:
00098 
00099   FiniteCylinderSpatialFunction();
00100   virtual ~FiniteCylinderSpatialFunction();
00101 
00102   void PrintSelf(std::ostream & os, Indent indent) const;
00103 
00104 private:
00105 
00106   FiniteCylinderSpatialFunction(const Self &); //purposely not implemented
00107   void operator=(const Self &);                //purposely not implemented
00108 
00110   InputType m_Center;
00111 
00113   double m_AxisLength;
00114 
00116   double m_Radius;
00117 
00119   InputType m_Orientation;
00120 };
00121 } // end namespace itk
00122 
00123 // Define instantiation macro for this template.
00124 #define ITK_TEMPLATE_FiniteCylinderSpatialFunction(_, EXPORT, TypeX, TypeY)     \
00125   namespace itk                                                                 \
00126   {                                                                             \
00127   _( 2 ( class EXPORT FiniteCylinderSpatialFunction< ITK_TEMPLATE_2 TypeX > ) ) \
00128   namespace Templates                                                           \
00129   {                                                                             \
00130   typedef FiniteCylinderSpatialFunction< ITK_TEMPLATE_2 TypeX >                 \
00131   FiniteCylinderSpatialFunction##TypeY;                                       \
00132   }                                                                             \
00133   }
00134 
00135 #if ITK_TEMPLATE_EXPLICIT
00136 #include "Templates/itkFiniteCylinderSpatialFunction+-.h"
00137 #endif
00138 
00139 #if ITK_TEMPLATE_TXX
00140 #include "itkFiniteCylinderSpatialFunction.hxx"
00141 #endif
00142 
00143 #endif
00144