itkGradientMagnitudeImageFilter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkGradientMagnitudeImageFilter_h
00018 #define __itkGradientMagnitudeImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkImage.h"
00022
00023 namespace itk
00024 {
00036 template <typename TInputImage, typename TOutputImage>
00037 class ITK_EXPORT GradientMagnitudeImageFilter :
00038 public ImageToImageFilter< TInputImage, TOutputImage >
00039 {
00040 public:
00042 typedef GradientMagnitudeImageFilter Self;
00043 typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00044 typedef SmartPointer<Self> Pointer;
00045 typedef SmartPointer<const Self> ConstPointer;
00046
00048 itkNewMacro(Self);
00049
00051 itkTypeMacro(GradientMagnitudeImageFilter, ImageToImageFilter);
00052
00055 typedef typename TOutputImage::PixelType OutputPixelType;
00056 typedef typename TInputImage::PixelType InputPixelType;
00057 typedef typename NumericTraits<InputPixelType>::RealType RealType;
00058
00061 itkStaticConstMacro(ImageDimension, unsigned int,
00062 TOutputImage::ImageDimension);
00063
00065 typedef TInputImage InputImageType;
00066 typedef TOutputImage OutputImageType;
00067 typedef typename InputImageType::Pointer InputImagePointer;
00068 typedef typename OutputImageType::Pointer OutputImagePointer;
00069
00071 typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00072
00081 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00082
00085 void SetUseImageSpacingOn()
00086 { this->SetUseImageSpacing(true); }
00087
00090 void SetUseImageSpacingOff()
00091 { this->SetUseImageSpacing(false); }
00092
00095 itkSetMacro(UseImageSpacing, bool);
00096 itkGetConstMacro(UseImageSpacing, bool);
00098
00099 #ifdef ITK_USE_CONCEPT_CHECKING
00100
00101 itkConceptMacro(InputHasNumericTraitsCheck,
00102 (Concept::HasNumericTraits<InputPixelType>));
00103
00105 #endif
00106
00107 protected:
00108 GradientMagnitudeImageFilter()
00109 {
00110 m_UseImageSpacing = true;
00111 }
00112 virtual ~GradientMagnitudeImageFilter() {}
00113
00125 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00126 int threadId );
00127
00128 void PrintSelf(std::ostream&, Indent) const;
00129
00130
00131 private:
00132 GradientMagnitudeImageFilter(const Self&);
00133 void operator=(const Self&);
00134
00135 bool m_UseImageSpacing;
00136
00137 };
00138
00139 }
00140
00141 #ifndef ITK_MANUAL_INSTANTIATION
00142 #include "itkGradientMagnitudeImageFilter.txx"
00143 #endif
00144
00145 #endif
00146