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 __itkVectorMeanImageFunction_h 00019 #define __itkVectorMeanImageFunction_h 00020 00021 #include "itkImageFunction.h" 00022 #include "itkNumericTraits.h" 00023 00024 namespace itk 00025 { 00044 template< class TInputImage, class TCoordRep = float > 00045 class ITK_EXPORT VectorMeanImageFunction: 00046 public ImageFunction< TInputImage, 00047 FixedArray< 00048 typename NumericTraits< typename TInputImage::PixelType::ValueType >::RealType, 00049 ::itk::GetVectorDimension< typename TInputImage::PixelType >::VectorDimension >, 00050 TCoordRep > 00051 { 00052 public: 00053 00055 typedef VectorMeanImageFunction Self; 00056 typedef ImageFunction< TInputImage, 00057 FixedArray< 00058 typename NumericTraits< typename TInputImage::PixelType::ValueType >::RealType, 00059 ::itk::GetVectorDimension< typename TInputImage::PixelType >::VectorDimension >, 00060 TCoordRep > Superclass; 00061 00062 typedef SmartPointer< Self > Pointer; 00063 typedef SmartPointer< const Self > ConstPointer; 00064 00066 itkTypeMacro(VectorMeanImageFunction, ImageFunction); 00067 00069 itkNewMacro(Self); 00070 00072 typedef TInputImage InputImageType; 00073 00075 typedef typename Superclass::OutputType OutputType; 00076 00078 typedef typename Superclass::IndexType IndexType; 00079 00081 typedef typename Superclass::ContinuousIndexType ContinuousIndexType; 00082 00084 typedef typename Superclass::PointType PointType; 00085 00087 itkStaticConstMacro(ImageDimension, unsigned int, 00088 InputImageType::ImageDimension); 00089 00091 typedef FixedArray< 00092 typename NumericTraits< typename InputImageType::PixelType::ValueType >::RealType, 00093 ::itk::GetVectorDimension< typename TInputImage::PixelType >::VectorDimension > 00094 RealType; 00095 00097 virtual RealType EvaluateAtIndex(const IndexType & index) const; 00098 00100 virtual RealType Evaluate(const PointType & point) const 00101 { 00102 IndexType index; 00103 00104 this->ConvertPointToNearestIndex(point, index); 00105 return this->EvaluateAtIndex(index); 00106 } 00107 00108 virtual RealType EvaluateAtContinuousIndex( 00109 const ContinuousIndexType & cindex) const 00110 { 00111 IndexType index; 00112 00113 this->ConvertContinuousIndexToNearestIndex(cindex, index); 00114 return this->EvaluateAtIndex(index); 00115 } 00116 00119 itkSetMacro(NeighborhoodRadius, unsigned int); 00120 itkGetConstReferenceMacro(NeighborhoodRadius, unsigned int); 00121 protected: 00122 VectorMeanImageFunction(); 00123 ~VectorMeanImageFunction(){} 00124 void PrintSelf(std::ostream & os, Indent indent) const; 00126 00127 private: 00128 VectorMeanImageFunction(const Self &); //purposely not implemented 00129 void operator=(const Self &); //purposely not implemented 00130 00131 unsigned int m_NeighborhoodRadius; 00132 }; 00133 } // end namespace itk 00134 00135 // Define instantiation macro for this template. 00136 #define ITK_TEMPLATE_VectorMeanImageFunction(_, EXPORT, TypeX, TypeY) \ 00137 namespace itk \ 00138 { \ 00139 _( 2 ( class EXPORT VectorMeanImageFunction< ITK_TEMPLATE_2 TypeX > ) ) \ 00140 namespace Templates \ 00141 { \ 00142 typedef VectorMeanImageFunction< ITK_TEMPLATE_2 TypeX > \ 00143 VectorMeanImageFunction##TypeY; \ 00144 } \ 00145 } 00146 00147 #if ITK_TEMPLATE_EXPLICIT 00148 #include "Templates/itkVectorMeanImageFunction+-.h" 00149 #endif 00150 00151 #if ITK_TEMPLATE_TXX 00152 #include "itkVectorMeanImageFunction.hxx" 00153 #endif 00154 00155 #endif 00156