ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkShapeSignedDistanceFunction.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 __itkShapeSignedDistanceFunction_h
00019 #define __itkShapeSignedDistanceFunction_h
00020 
00021 #include "itkSpatialFunction.h"
00022 #include "itkOptimizerParameters.h"
00023 
00024 namespace itk
00025 {
00051 template< typename TCoordRep, unsigned int VSpaceDimension >
00052 class ITK_EXPORT ShapeSignedDistanceFunction:
00053   public SpatialFunction< double, VSpaceDimension, Point< TCoordRep, VSpaceDimension > >
00054 {
00055 public:
00057   typedef ShapeSignedDistanceFunction Self;
00058   typedef SpatialFunction< double, VSpaceDimension,
00059                            Point< TCoordRep, VSpaceDimension > > Superclass;
00060 
00061   typedef SmartPointer< Self >       Pointer;
00062   typedef SmartPointer< const Self > ConstPointer;
00063 
00065   itkTypeMacro(ShapeSignedDistanceFunction, SpatialFunction);
00066 
00068   typedef typename Superclass::OutputType OutputType;
00069 
00071   typedef typename Superclass::InputType InputType;
00072 
00074   itkStaticConstMacro(SpaceDimension, unsigned int, VSpaceDimension);
00075 
00077   typedef TCoordRep CoordRepType;
00078 
00080   typedef InputType PointType;
00081 
00083   typedef OptimizerParameters< double > ParametersType;
00084 
00086   virtual void SetParameters(const ParametersType &) = 0;
00087 
00088   virtual ParametersType & GetParameters(void)
00089   { return m_Parameters; }
00090   virtual unsigned int GetNumberOfShapeParameters(void) const = 0;
00091 
00092   virtual unsigned int GetNumberOfPoseParameters(void) const = 0;
00093 
00094   virtual unsigned int GetNumberOfParameters(void) const
00095   { return this->GetNumberOfShapeParameters() + this->GetNumberOfPoseParameters(); }
00096 
00098   virtual OutputType Evaluate(const PointType & point) const = 0;
00099 
00102   virtual void Initialize()
00103   throw ( ExceptionObject ) {}
00104 protected:
00105 
00106   ShapeSignedDistanceFunction() {}
00107 
00108   ~ShapeSignedDistanceFunction(){}
00109 
00110   void PrintSelf(std::ostream & os, Indent indent) const
00111   {
00112     Superclass::PrintSelf(os, indent);
00113 //FIX    os << indent << "Parameters: " << m_Parameters << std::endl;
00114   }
00115 
00116   ParametersType m_Parameters;
00117 private:
00118   ShapeSignedDistanceFunction(const Self &); //purposely not implemented
00119   void operator=(const Self &);              //purposely not implemented
00120 };
00121 } // end namespace itk
00122 
00123 #endif
00124