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
00027
00028 namespace itk
00029 {
00030
00042
00043
00044
00045 template <typename TInputImage,
00046 typename TOutputImage= Image< CovariantVector<
00047 ITK_TYPENAME NumericTraits< ITK_TYPENAME TInputImage::PixelType>::RealType,
00048 ::itk::GetImageDimension<TInputImage>::ImageDimension >,
00049 ::itk::GetImageDimension<TInputImage>::ImageDimension > >
00050 class ITK_EXPORT GradientRecursiveGaussianImageFilter:
00051 public ImageToImageFilter<TInputImage,TOutputImage>
00052 {
00053 public:
00055 typedef GradientRecursiveGaussianImageFilter Self;
00056 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00057 typedef SmartPointer<Self> Pointer;
00058 typedef SmartPointer<const Self> ConstPointer;
00059
00060
00062 typedef TInputImage InputImageType;
00063 typedef typename TInputImage::PixelType PixelType;
00064 typedef typename NumericTraits<PixelType>::RealType RealType;
00065
00066
00068 itkStaticConstMacro(ImageDimension, unsigned int,
00069 TInputImage::ImageDimension);
00070
00075 typedef float InternalRealType;
00076 typedef Image<InternalRealType,
00077 itkGetStaticConstMacro(ImageDimension) > RealImageType;
00078
00079
00080
00081
00086 typedef NthElementImageAdaptor< TOutputImage,
00087 InternalRealType > OutputImageAdaptorType;
00088 typedef typename OutputImageAdaptorType::Pointer OutputImageAdaptorPointer;
00089
00091 typedef RecursiveGaussianImageFilter<
00092 RealImageType,
00093 RealImageType
00094 > GaussianFilterType;
00095
00097 typedef RecursiveGaussianImageFilter<
00098 InputImageType,
00099 RealImageType
00100 > DerivativeFilterType;
00101
00102
00104 typedef typename GaussianFilterType::Pointer GaussianFilterPointer;
00105
00107 typedef typename DerivativeFilterType::Pointer DerivativeFilterPointer;
00108
00110 typedef typename TOutputImage::Pointer OutputImagePointer;
00111
00112
00114 typedef TOutputImage OutputImageType;
00115 typedef typename OutputImageType::PixelType OutputPixelType;
00116 typedef typename PixelTraits<OutputPixelType>::ValueType OutputComponentType;
00117
00119 itkNewMacro(Self);
00120
00122 void SetSigma( RealType sigma );
00123
00125 void SetNormalizeAcrossScale( bool normalizeInScaleSpace );
00126 itkGetMacro( NormalizeAcrossScale, bool );
00128
00134 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00135
00136 #ifdef ITK_USE_CONCEPT_CHECKING
00137
00138 itkConceptMacro(InputHasNumericTraitsCheck,
00139 (Concept::HasNumericTraits<PixelType>));
00140 itkConceptMacro(OutputHasPixelTraitsCheck,
00141 (Concept::HasPixelTraits<OutputPixelType>));
00142
00144 #endif
00145
00146 protected:
00147 GradientRecursiveGaussianImageFilter();
00148 virtual ~GradientRecursiveGaussianImageFilter() {};
00149 void PrintSelf(std::ostream& os, Indent indent) const;
00150
00152 void GenerateData( void );
00153
00154
00155 void EnlargeOutputRequestedRegion(DataObject *output);
00156
00157 private:
00158 GradientRecursiveGaussianImageFilter(const Self&);
00159 void operator=(const Self&);
00160
00161 GaussianFilterPointer m_SmoothingFilters[ImageDimension-1];
00162 DerivativeFilterPointer m_DerivativeFilter;
00163 OutputImageAdaptorPointer m_ImageAdaptor;
00164
00166 bool m_NormalizeAcrossScale;
00167
00168 };
00169
00170 }
00171
00172 #ifndef ITK_MANUAL_INSTANTIATION
00173 #include "itkGradientRecursiveGaussianImageFilter.txx"
00174 #endif
00175
00176 #endif
00177
00178
00179
00180
00181