Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkGradientMagnitudeImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkGradientMagnitudeImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-10-16 16:45:08 $
00007   Version:   $Revision: 1.29 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
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);
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&); //purposely not implemented
00133   void operator=(const Self&); //purposely not implemented
00134 
00135   bool m_UseImageSpacing;
00136 
00137 };
00138   
00139 } // end namespace itk
00140 
00141 #ifndef ITK_MANUAL_INSTANTIATION
00142 #include "itkGradientMagnitudeImageFilter.txx"
00143 #endif
00144 
00145 #endif
00146 

Generated at Sat Feb 28 12:30:41 2009 for ITK by doxygen 1.5.6 written by Dimitri van Heesch, © 1997-2000