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 "itkPixelTraits.h"
00024 #include "itkCommand.h"
00025
00026
00027 namespace itk
00028 {
00029
00041
00042
00043
00044 template <typename TInputImage,
00045 typename TOutputImage= Image< CovariantVector<
00046 ITK_TYPENAME NumericTraits< ITK_TYPENAME TInputImage::PixelType>::RealType,
00047 ::itk::GetImageDimension<TInputImage>::ImageDimension >,
00048 ::itk::GetImageDimension<TInputImage>::ImageDimension > >
00049 class ITK_EXPORT GradientRecursiveGaussianImageFilter:
00050 public ImageToImageFilter<TInputImage,TOutputImage>
00051 {
00052 public:
00054 typedef GradientRecursiveGaussianImageFilter Self;
00055 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00056 typedef SmartPointer<Self> Pointer;
00057 typedef SmartPointer<const Self> ConstPointer;
00058
00059
00061 typedef TInputImage InputImageType;
00062 typedef typename TInputImage::PixelType PixelType;
00063 typedef typename NumericTraits<PixelType>::RealType RealType;
00064
00065
00067 itkStaticConstMacro(ImageDimension, unsigned int,
00068 TInputImage::ImageDimension);
00069
00074 typedef float InternalRealType;
00075 typedef Image<InternalRealType,
00076 itkGetStaticConstMacro(ImageDimension) > RealImageType;
00077
00078
00079
00080
00085 typedef NthElementImageAdaptor< TOutputImage,
00086 InternalRealType > OutputImageAdaptorType;
00087 typedef typename OutputImageAdaptorType::Pointer OutputImageAdaptorPointer;
00088
00090 typedef RecursiveGaussianImageFilter<
00091 RealImageType,
00092 RealImageType
00093 > GaussianFilterType;
00094
00096 typedef RecursiveGaussianImageFilter<
00097 InputImageType,
00098 RealImageType
00099 > DerivativeFilterType;
00100
00101
00103 typedef typename GaussianFilterType::Pointer GaussianFilterPointer;
00104
00106 typedef typename DerivativeFilterType::Pointer DerivativeFilterPointer;
00107
00109 typedef typename TOutputImage::Pointer OutputImagePointer;
00110
00111
00113 typedef TOutputImage OutputImageType;
00114 typedef typename OutputImageType::PixelType OutputPixelType;
00115 typedef typename PixelTraits<OutputPixelType>::ValueType OutputComponentType;
00116
00118 typedef MemberCommand< Self > CommandType;
00119 typedef typename CommandType::Pointer CommandPointer;
00120
00122 itkNewMacro(Self);
00123
00125 void SetSigma( RealType sigma );
00126
00128 void SetNormalizeAcrossScale( bool normalizeInScaleSpace );
00129 itkGetMacro( NormalizeAcrossScale, bool );
00130
00136 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00137
00138 protected:
00139 GradientRecursiveGaussianImageFilter();
00140 virtual ~GradientRecursiveGaussianImageFilter() {};
00141 void PrintSelf(std::ostream& os, Indent indent) const;
00142
00144 void GenerateData( void );
00145
00146
00147 void EnlargeOutputRequestedRegion(DataObject *output);
00148
00150 void ReportProgress(const Object * object, const EventObject & event );
00151
00152 private:
00153 GradientRecursiveGaussianImageFilter(const Self&);
00154 void operator=(const Self&);
00155
00156 GaussianFilterPointer m_SmoothingFilters[ImageDimension-1];
00157 DerivativeFilterPointer m_DerivativeFilter;
00158 OutputImageAdaptorPointer m_ImageAdaptor;
00159
00160 CommandPointer m_ProgressCommand;
00161 float m_Progress;
00162
00164 bool m_NormalizeAcrossScale;
00165
00166 };
00167
00168 }
00169
00170 #ifndef ITK_MANUAL_INSTANTIATION
00171 #include "itkGradientRecursiveGaussianImageFilter.txx"
00172 #endif
00173
00174 #endif
00175
00176
00177
00178