00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkHessianRecursiveGaussianImageFilter_h
00018 #define __itkHessianRecursiveGaussianImageFilter_h
00019
00020 #include "itkRecursiveGaussianImageFilter.h"
00021 #include "itkNthElementImageAdaptor.h"
00022 #include "itkImage.h"
00023 #include "itkSymmetricSecondRankTensor.h"
00024 #include "itkPixelTraits.h"
00025 #include "itkCommand.h"
00026 #include "itkProgressAccumulator.h"
00027
00028
00029 namespace itk
00030 {
00031
00043
00044
00045
00046 template <typename TInputImage,
00047 typename TOutputImage= Image< SymmetricSecondRankTensor<
00048 ITK_TYPENAME NumericTraits< ITK_TYPENAME TInputImage::PixelType>::RealType,
00049 ::itk::GetImageDimension<TInputImage>::ImageDimension >,
00050 ::itk::GetImageDimension<TInputImage>::ImageDimension > >
00051 class ITK_EXPORT HessianRecursiveGaussianImageFilter:
00052 public ImageToImageFilter<TInputImage,TOutputImage>
00053 {
00054 public:
00056 typedef HessianRecursiveGaussianImageFilter 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 ::itk::GetImageDimension<TInputImage>::ImageDimension);
00071
00073 itkStaticConstMacro(NumberOfSmoothingFilters, unsigned int,
00074 ::itk::GetImageDimension<TInputImage>::ImageDimension-2);
00075
00080 typedef float InternalRealType;
00081 typedef Image<InternalRealType,
00082 ::itk::GetImageDimension<TInputImage>::ImageDimension > RealImageType;
00083
00084
00085
00086
00091 typedef NthElementImageAdaptor< TOutputImage,
00092 InternalRealType > OutputImageAdaptorType;
00093 typedef typename OutputImageAdaptorType::Pointer OutputImageAdaptorPointer;
00094
00096 typedef RecursiveGaussianImageFilter<
00097 RealImageType,
00098 RealImageType
00099 > GaussianFilterType;
00100
00102 typedef RecursiveGaussianImageFilter<
00103 InputImageType,
00104 RealImageType
00105 > DerivativeFilterAType;
00106
00107 typedef RecursiveGaussianImageFilter<
00108 RealImageType,
00109 RealImageType
00110 > DerivativeFilterBType;
00111
00113 typedef typename GaussianFilterType::Pointer GaussianFilterPointer;
00114 typedef std::vector< GaussianFilterPointer > GaussianFiltersArray;
00115
00117 typedef typename DerivativeFilterAType::Pointer DerivativeFilterAPointer;
00118 typedef typename DerivativeFilterBType::Pointer DerivativeFilterBPointer;
00119
00121 typedef typename TOutputImage::Pointer OutputImagePointer;
00122
00123
00125 typedef TOutputImage OutputImageType;
00126 typedef typename OutputImageType::PixelType OutputPixelType;
00127 typedef typename PixelTraits<OutputPixelType>::ValueType OutputComponentType;
00128
00130 itkNewMacro(Self);
00131
00133 void SetSigma( RealType sigma );
00134
00136 void SetNormalizeAcrossScale( bool normalizeInScaleSpace );
00137 itkGetMacro( NormalizeAcrossScale, bool );
00138
00144 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00145
00146 protected:
00147
00148 HessianRecursiveGaussianImageFilter();
00149 virtual ~HessianRecursiveGaussianImageFilter() {};
00150 void PrintSelf(std::ostream& os, Indent indent) const;
00151
00153 void GenerateData( void );
00154
00155
00156 void EnlargeOutputRequestedRegion(DataObject *output);
00157
00158
00159 private:
00160
00161 HessianRecursiveGaussianImageFilter(const Self&);
00162 void operator=(const Self&);
00163
00164 GaussianFiltersArray m_SmoothingFilters;
00165 DerivativeFilterAPointer m_DerivativeFilterA;
00166 DerivativeFilterBPointer m_DerivativeFilterB;
00167 OutputImageAdaptorPointer m_ImageAdaptor;
00168
00170 bool m_NormalizeAcrossScale;
00171
00172 ProgressAccumulator::Pointer m_Progress;
00173
00174 };
00175
00176 }
00177
00178 #ifndef ITK_MANUAL_INSTANTIATION
00179 #include "itkHessianRecursiveGaussianImageFilter.txx"
00180 #endif
00181
00182 #endif
00183
00184
00185
00186