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

itkGradientImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkGradientImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/10/08 11:18:50 $
00007   Version:   $Revision: 1.16 $
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 __itkGradientImageFilter_h
00018 #define __itkGradientImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkImage.h"
00022 #include "itkCovariantVector.h"
00023 
00024 namespace itk
00025 {
00047 template <class TInputImage, class TOperatorValueType=float, class TOutputValueType=float>
00048 class ITK_EXPORT GradientImageFilter :
00049     public ImageToImageFilter< TInputImage,
00050                                Image<CovariantVector<TOutputValueType, ::itk::GetImageDimension<TInputImage>::ImageDimension>,  ::itk::GetImageDimension<TInputImage>::ImageDimension> >
00051 {
00052 public:
00054   itkStaticConstMacro(InputImageDimension, unsigned int,
00055                       TInputImage::ImageDimension);
00056   itkStaticConstMacro(OutputImageDimension, unsigned int,
00057                       TInputImage::ImageDimension);
00059 
00061   typedef GradientImageFilter Self;
00062 
00064   typedef TInputImage InputImageType;
00065   typedef typename InputImageType::Pointer InputImagePointer;
00066   typedef Image<CovariantVector<TOutputValueType, itkGetStaticConstMacro(OutputImageDimension)>,  itkGetStaticConstMacro(OutputImageDimension)> OutputImageType;
00067   typedef typename OutputImageType::Pointer OutputImagePointer;
00068 
00070   typedef ImageToImageFilter< InputImageType, OutputImageType> Superclass;
00071   typedef SmartPointer<Self> Pointer;
00072   typedef SmartPointer<const Self>  ConstPointer;
00073 
00075   itkNewMacro(Self);
00076 
00078   itkTypeMacro(GradientImageFilter, ImageToImageFilter);
00079 
00081   typedef typename InputImageType::PixelType InputPixelType;
00082   typedef TOperatorValueType OperatorValueType;
00083   typedef TOutputValueType OutputValueType;
00084   typedef CovariantVector<OutputValueType, itkGetStaticConstMacro(OutputImageDimension)> OutputPixelType;
00085   typedef typename OutputImageType::RegionType OutputImageRegionType;
00086 
00093   virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00094 
00097   void SetUseImageSpacingOn()
00098   { this->SetUseImageSpacing(true); }
00099 
00102   void SetUseImageSpacingOff()
00103   { this->SetUseImageSpacing(false); }
00104 
00107   itkSetMacro(UseImageSpacing, bool);
00108   itkGetMacro(UseImageSpacing, bool);
00110 
00111 #ifdef ITK_USE_CONCEPT_CHECKING
00112 
00113   itkConceptMacro(InputConvertibleToOutputCheck,
00114     (Concept::Convertible<InputPixelType, OutputValueType>));
00115   itkConceptMacro(OutputHasNumericTraitsCheck,
00116     (Concept::HasNumericTraits<OutputValueType>));
00117 
00119 #endif
00120 
00129   itkSetMacro( UseImageDirection, bool );
00130   itkGetMacro( UseImageDirection, bool );
00131   itkBooleanMacro( UseImageDirection );
00133 
00134 protected:
00135   GradientImageFilter();
00136   virtual ~GradientImageFilter();
00137   void PrintSelf(std::ostream& os, Indent indent) const;
00138 
00149   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00150                             int threadId );
00151 
00152 private:
00153   GradientImageFilter(const Self&); //purposely not implemented
00154   void operator=(const Self&); //purposely not implemented
00155 
00156   bool m_UseImageSpacing;
00157 
00158   // flag to take or not the image direction into account
00159   // when computing the derivatives.
00160   bool m_UseImageDirection;
00161 
00162 };
00163   
00164 } // end namespace itk
00165 
00166 #ifndef ITK_MANUAL_INSTANTIATION
00167 #include "itkGradientImageFilter.txx"
00168 #endif
00169 
00170 #endif
00171 

Generated at Tue Jul 29 20:12:13 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000