00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkSphereSignedDistanceFunction.h,v $ 00005 Language: C++ 00006 Date: $Date: 2004/01/12 19:46:07 $ 00007 Version: $Revision: 1.4 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef _itkSphereSignedDistanceFunction_h 00018 #define _itkSphereSignedDistanceFunction_h 00019 00020 #include "itkShapeSignedDistanceFunction.h" 00021 #include "itkVector.h" 00022 00023 namespace itk 00024 { 00025 00041 template <typename TCoordRep, unsigned int VSpaceDimension> 00042 class ITK_EXPORT SphereSignedDistanceFunction : 00043 public ShapeSignedDistanceFunction< TCoordRep, VSpaceDimension > 00044 { 00045 public: 00047 typedef SphereSignedDistanceFunction Self; 00048 typedef ShapeSignedDistanceFunction< TCoordRep, VSpaceDimension > Superclass; 00049 typedef SmartPointer<Self> Pointer; 00050 typedef SmartPointer<const Self> ConstPointer; 00051 00053 itkTypeMacro(SphereSignedDistanceFunction, ShapeSignedDistancFunction); 00054 00056 itkNewMacro( Self ); 00057 00059 typedef typename Superclass::OutputType OutputType; 00060 00062 typedef typename Superclass::InputType InputType; 00063 00065 itkStaticConstMacro(SpaceDimension, unsigned int, Superclass::SpaceDimension); 00066 00068 typedef typename Superclass::CoordRepType CoordRepType; 00069 00071 typedef typename Superclass::PointType PointType; 00072 00074 typedef typename Superclass::ParametersType ParametersType; 00075 00078 virtual void SetParameters( const ParametersType & ); 00079 virtual const ParametersType& GetParameters(void) const; 00080 virtual unsigned int GetNumberOfShapeParameters(void) const 00081 { return 1; } 00082 virtual unsigned int GetNumberOfPoseParameters(void) const 00083 { return SpaceDimension; } 00084 00086 virtual OutputType Evaluate( const PointType& point ) const; 00087 00088 protected: 00089 SphereSignedDistanceFunction(); 00090 ~SphereSignedDistanceFunction(){}; 00091 00092 void PrintSelf(std::ostream& os, Indent indent) const; 00093 00094 private: 00095 SphereSignedDistanceFunction( const Self& ); //purposely not implemented 00096 void operator=( const Self& ); //purposely not implemented 00097 00098 typedef Vector<CoordRepType,itkGetStaticConstMacro(SpaceDimension)> VectorType; 00099 00100 VectorType m_Translation; 00101 double m_Radius; 00102 00103 }; 00104 00105 } // namespace itk 00106 00107 #ifndef ITK_MANUAL_INSTANTIATION 00108 #include "itkSphereSignedDistanceFunction.txx" 00109 #endif 00110 00111 #endif