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
itkGetMacro(UseImageSpacing,
bool);
00097
00098
protected:
00099 GradientMagnitudeImageFilter()
00100 {
00101 m_UseImageSpacing =
true;
00102 }
00103
virtual ~GradientMagnitudeImageFilter() {}
00104
00116
void ThreadedGenerateData(
const OutputImageRegionType& outputRegionForThread,
00117
int threadId );
00118
00119
void PrintSelf(std::ostream&,
Indent) const;
00120
00121
00122 private:
00123 GradientMagnitudeImageFilter(const
Self&);
00124
void operator=(const Self&);
00125
00126
bool m_UseImageSpacing;
00127
00128 };
00129
00130 }
00131
00132 #ifndef ITK_MANUAL_INSTANTIATION
00133 #include "itkGradientMagnitudeImageFilter.txx"
00134 #endif
00135
00136 #endif