ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkSphereSignedDistanceFunction.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 __itkSphereSignedDistanceFunction_h
00019 #define __itkSphereSignedDistanceFunction_h
00020 
00021 #include "itkShapeSignedDistanceFunction.h"
00022 #include "itkVector.h"
00023 
00024 namespace itk
00025 {
00043 template< typename TCoordRep, unsigned int VSpaceDimension >
00044 class ITK_EXPORT SphereSignedDistanceFunction:
00045   public ShapeSignedDistanceFunction< TCoordRep, VSpaceDimension >
00046 {
00047 public:
00049   typedef SphereSignedDistanceFunction                              Self;
00050   typedef ShapeSignedDistanceFunction< TCoordRep, VSpaceDimension > Superclass;
00051   typedef SmartPointer< Self >                                      Pointer;
00052   typedef SmartPointer< const Self >                                ConstPointer;
00053 
00055   itkTypeMacro(SphereSignedDistanceFunction, ShapeSignedDistancFunction);
00056 
00058   itkNewMacro(Self);
00059 
00061   typedef typename Superclass::OutputType OutputType;
00062 
00064   typedef typename Superclass::InputType InputType;
00065 
00067   itkStaticConstMacro(SpaceDimension, unsigned int, Superclass::SpaceDimension);
00068 
00070   typedef typename Superclass::CoordRepType CoordRepType;
00071 
00073   typedef typename Superclass::PointType PointType;
00074 
00076   typedef typename Superclass::ParametersType ParametersType;
00077 
00080   virtual void SetParameters(const ParametersType &);
00081 
00082   virtual unsigned int GetNumberOfShapeParameters(void) const
00083   { return 1; }
00084   virtual unsigned int GetNumberOfPoseParameters(void) const
00085   { return SpaceDimension; }
00086 
00088   virtual OutputType Evaluate(const PointType & point) const;
00089 
00090 protected:
00091   SphereSignedDistanceFunction();
00092   ~SphereSignedDistanceFunction(){}
00093 
00094   void PrintSelf(std::ostream & os, Indent indent) const;
00095 
00096 private:
00097   SphereSignedDistanceFunction(const Self &); //purposely not implemented
00098   void operator=(const Self &);               //purposely not implemented
00099 
00100   typedef Vector< CoordRepType, itkGetStaticConstMacro(SpaceDimension) > VectorType;
00101 
00102   VectorType m_Translation;
00103   double     m_Radius;
00104 };
00105 } // end namespace itk
00106 
00107 // Define instantiation macro for this template.
00108 #define ITK_TEMPLATE_SphereSignedDistanceFunction(_, EXPORT, TypeX, TypeY)     \
00109   namespace itk                                                                \
00110   {                                                                            \
00111   _( 2 ( class EXPORT SphereSignedDistanceFunction< ITK_TEMPLATE_2 TypeX > ) ) \
00112   namespace Templates                                                          \
00113   {                                                                            \
00114   typedef SphereSignedDistanceFunction< ITK_TEMPLATE_2 TypeX >                 \
00115   SphereSignedDistanceFunction##TypeY;                                       \
00116   }                                                                            \
00117   }
00118 
00119 #if ITK_TEMPLATE_EXPLICIT
00120 #include "Templates/itkSphereSignedDistanceFunction+-.h"
00121 #endif
00122 
00123 #if ITK_TEMPLATE_TXX
00124 #include "itkSphereSignedDistanceFunction.hxx"
00125 #endif
00126 
00127 #endif
00128