00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkGradientRecursiveGaussianImageFilter_h
00018 #define __itkGradientRecursiveGaussianImageFilter_h
00019
00020 #include "itkRecursiveGaussianImageFilter.h"
00021 #include "itkNthElementImageAdaptor.h"
00022 #include "itkImage.h"
00023 #include "itkCovariantVector.h"
00024 #include "itkPixelTraits.h"
00025 #include "itkProgressAccumulator.h"
00026 #include <vector>
00027
00028
00029 namespace itk
00030 {
00031
00043
00044
00045
00046 template <typename TInputImage,
00047 typename TOutputImage= Image< CovariantVector<
00048 ITK_TYPENAME NumericTraits< ITK_TYPENAME TInputImage::PixelType>::RealType,
00049 ::itk::GetImageDimension<TInputImage>::ImageDimension >,
00050 ::itk::GetImageDimension<TInputImage>::ImageDimension > >
00051 class ITK_EXPORT GradientRecursiveGaussianImageFilter:
00052 public ImageToImageFilter<TInputImage,TOutputImage>
00053 {
00054 public:
00056 typedef GradientRecursiveGaussianImageFilter Self;
00057 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00058 typedef SmartPointer<Self> Pointer;
00059 typedef SmartPointer<const Self> ConstPointer;
00060
00061
00063 typedef TInputImage InputImageType;
00064 typedef typename TInputImage::PixelType PixelType;
00065 typedef typename NumericTraits<PixelType>::RealType RealType;
00066
00067
00069 itkStaticConstMacro(ImageDimension, unsigned int,
00070 TInputImage::ImageDimension);
00071
00076 typedef float InternalRealType;
00077 typedef Image<InternalRealType,
00078 itkGetStaticConstMacro(ImageDimension) > RealImageType;
00079
00080
00081
00082
00087 typedef NthElementImageAdaptor< TOutputImage,
00088 InternalRealType > OutputImageAdaptorType;
00089 typedef typename OutputImageAdaptorType::Pointer OutputImageAdaptorPointer;
00090
00092 typedef RecursiveGaussianImageFilter<
00093 RealImageType,
00094 RealImageType
00095 > GaussianFilterType;
00096
00098 typedef RecursiveGaussianImageFilter<
00099 InputImageType,
00100 RealImageType
00101 > DerivativeFilterType;
00102
00103
00105 typedef typename GaussianFilterType::Pointer GaussianFilterPointer;
00106
00108 typedef typename DerivativeFilterType::Pointer DerivativeFilterPointer;
00109
00111 typedef typename TOutputImage::Pointer OutputImagePointer;
00112
00113
00115 typedef TOutputImage OutputImageType;
00116 typedef typename OutputImageType::PixelType OutputPixelType;
00117 typedef typename PixelTraits<OutputPixelType>::ValueType OutputComponentType;
00118
00120 itkNewMacro(Self);
00121
00123 void SetSigma( RealType sigma );
00124
00126 void SetNormalizeAcrossScale( bool normalizeInScaleSpace );
00127 itkGetMacro( NormalizeAcrossScale, bool );
00129
00135 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00136
00137 #ifdef ITK_USE_CONCEPT_CHECKING
00138
00139 itkConceptMacro(InputHasNumericTraitsCheck,
00140 (Concept::HasNumericTraits<PixelType>));
00141 itkConceptMacro(OutputHasPixelTraitsCheck,
00142 (Concept::HasPixelTraits<OutputPixelType>));
00143
00145 #endif
00146
00147 protected:
00148 GradientRecursiveGaussianImageFilter();
00149 virtual ~GradientRecursiveGaussianImageFilter() {};
00150 void PrintSelf(std::ostream& os, Indent indent) const;
00151
00153 void GenerateData( void );
00154
00155
00156 void EnlargeOutputRequestedRegion(DataObject *output);
00157
00158 private:
00159 GradientRecursiveGaussianImageFilter(const Self&);
00160 void operator=(const Self&);
00161
00162 std::vector<GaussianFilterPointer> m_SmoothingFilters;
00163 DerivativeFilterPointer m_DerivativeFilter;
00164 OutputImageAdaptorPointer m_ImageAdaptor;
00165
00167 bool m_NormalizeAcrossScale;
00168
00169 };
00170
00171 }
00172
00173 #ifndef ITK_MANUAL_INSTANTIATION
00174 #include "itkGradientRecursiveGaussianImageFilter.txx"
00175 #endif
00176
00177 #endif
00178
00179
00180
00181
00182