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
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 itkNewMacro(Self);
00119
00121 itkTypeMacro(GradientRecursiveGaussianImageFilter,
00122 ImageToImageFilter);
00123
00125 void SetSigma( RealType sigma );
00126
00128 void SetNormalizeAcrossScale( bool normalizeInScaleSpace );
00129 itkGetMacro( NormalizeAcrossScale, bool );
00131
00137 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00138
00147 itkSetMacro( UseImageDirection, bool );
00148 itkGetMacro( UseImageDirection, bool );
00149 itkBooleanMacro( UseImageDirection );
00151
00152 #ifdef ITK_USE_CONCEPT_CHECKING
00153
00154 itkConceptMacro(InputHasNumericTraitsCheck,
00155 (Concept::HasNumericTraits<PixelType>));
00156 itkConceptMacro(OutputHasPixelTraitsCheck,
00157 (Concept::HasPixelTraits<OutputPixelType>));
00158
00160 #endif
00161
00162 protected:
00163 GradientRecursiveGaussianImageFilter();
00164 virtual ~GradientRecursiveGaussianImageFilter() {};
00165 void PrintSelf(std::ostream& os, Indent indent) const;
00166
00168 void GenerateData( void );
00169
00170
00171 void EnlargeOutputRequestedRegion(DataObject *output);
00172
00173 private:
00174 GradientRecursiveGaussianImageFilter(const Self&);
00175 void operator=(const Self&);
00176
00177 std::vector<GaussianFilterPointer> m_SmoothingFilters;
00178 DerivativeFilterPointer m_DerivativeFilter;
00179 OutputImageAdaptorPointer m_ImageAdaptor;
00180
00182 bool m_NormalizeAcrossScale;
00183
00185 bool m_UseImageDirection;
00186 };
00187
00188 }
00189
00190 #ifndef ITK_MANUAL_INSTANTIATION
00191 #include "itkGradientRecursiveGaussianImageFilter.txx"
00192 #endif
00193
00194 #endif
00195