00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkSphereSignedDistanceFunction.h,v $ 00005 Language: C++ 00006 Date: $Date: 2004/12/12 22:07:24 $ 00007 Version: $Revision: 1.5 $ 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 unsigned int GetNumberOfShapeParameters(void) const 00080 { return 1; } 00081 virtual unsigned int GetNumberOfPoseParameters(void) const 00082 { return SpaceDimension; } 00083 00085 virtual OutputType Evaluate( const PointType& point ) const; 00086 00087 protected: 00088 SphereSignedDistanceFunction(); 00089 ~SphereSignedDistanceFunction(){}; 00090 00091 void PrintSelf(std::ostream& os, Indent indent) const; 00092 00093 private: 00094 SphereSignedDistanceFunction( const Self& ); //purposely not implemented 00095 void operator=( const Self& ); //purposely not implemented 00096 00097 typedef Vector<CoordRepType,itkGetStaticConstMacro(SpaceDimension)> VectorType; 00098 00099 VectorType m_Translation; 00100 double m_Radius; 00101 00102 }; 00103 00104 } // namespace itk 00105 00106 #ifndef ITK_MANUAL_INSTANTIATION 00107 #include "itkSphereSignedDistanceFunction.txx" 00108 #endif 00109 00110 #endif