ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
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 __itkSphereSpatialFunction_h 00019 #define __itkSphereSpatialFunction_h 00020 00021 #include "itkInteriorExteriorSpatialFunction.h" 00022 00023 namespace itk 00024 { 00034 template< unsigned int VImageDimension = 3, typename TInput = Point< double, VImageDimension > > 00035 class ITK_EXPORT SphereSpatialFunction: 00036 public InteriorExteriorSpatialFunction< VImageDimension, TInput > 00037 { 00038 public: 00040 typedef SphereSpatialFunction< VImageDimension, TInput > Self; 00041 typedef InteriorExteriorSpatialFunction< VImageDimension, TInput > Superclass; 00042 typedef SmartPointer< Self > Pointer; 00043 typedef SmartPointer< const Self > ConstPointer; 00044 00046 itkNewMacro(Self); 00047 00049 itkTypeMacro(SphereSpatialFunction, InteriorExteriorSpatialFunction); 00050 00052 typedef typename Superclass::InputType InputType; 00053 00055 typedef typename Superclass::OutputType OutputType; 00056 00058 OutputType Evaluate(const InputType & position) const; 00059 00061 itkGetConstMacro(Center, InputType); 00062 itkSetMacro(Center, InputType); 00064 00066 itkGetConstMacro(Radius, double); 00067 itkSetMacro(Radius, double); 00068 protected: 00069 SphereSpatialFunction(); 00070 virtual ~SphereSpatialFunction(); 00071 void PrintSelf(std::ostream & os, Indent indent) const; 00073 00074 private: 00075 SphereSpatialFunction(const Self &); //purposely not implemented 00076 void operator=(const Self &); //purposely not implemented 00077 00079 InputType m_Center; 00080 00082 double m_Radius; 00083 }; 00084 } // end namespace itk 00085 00086 // Define instantiation macro for this template. 00087 #define ITK_TEMPLATE_SphereSpatialFunction(_, EXPORT, TypeX, TypeY) \ 00088 namespace itk \ 00089 { \ 00090 _( 2 ( class EXPORT SphereSpatialFunction< ITK_TEMPLATE_2 TypeX > ) ) \ 00091 namespace Templates \ 00092 { \ 00093 typedef SphereSpatialFunction< ITK_TEMPLATE_2 TypeX > \ 00094 SphereSpatialFunction##TypeY; \ 00095 } \ 00096 } 00097 00098 #if ITK_TEMPLATE_EXPLICIT 00099 #include "Templates/itkSphereSpatialFunction+-.h" 00100 #endif 00101 00102 #if ITK_TEMPLATE_TXX 00103 #include "itkSphereSpatialFunction.hxx" 00104 #endif 00105 00106 #endif 00107