ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkDerivativeImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkDerivativeImageFilter_h
00019 #define __itkDerivativeImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 
00023 namespace itk
00024 {
00047 template< class TInputImage, class TOutputImage >
00048 class ITK_EXPORT DerivativeImageFilter:
00049   public ImageToImageFilter< TInputImage, TOutputImage >
00050 {
00051 public:
00053   typedef DerivativeImageFilter                           Self;
00054   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00055   typedef SmartPointer< Self >                            Pointer;
00056   typedef SmartPointer< const Self >                      ConstPointer;
00057 
00060   typedef typename TOutputImage::PixelType         OutputPixelType;
00061   typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
00062   typedef typename TInputImage::PixelType          InputPixelType;
00063   typedef typename TInputImage::InternalPixelType  InputInternalPixelType;
00064 
00067   itkStaticConstMacro(ImageDimension, unsigned int,
00068                       TOutputImage::ImageDimension);
00069 
00071   typedef TInputImage  InputImageType;
00072   typedef TOutputImage OutputImageType;
00073 
00075   itkNewMacro(Self);
00076 
00078   itkTypeMacro(DerivativeImageFilter, ImageToImageFilter);
00079 
00081 #ifdef ITK_USE_CONCEPT_CHECKING
00082 
00084   itkConceptMacro( SignedOutputPixelType,
00085                    ( Concept::Signed< OutputPixelType > ) );
00086 
00088 #endif
00089 
00091   itkSetMacro(Order, unsigned int);
00092   itkGetConstMacro(Order, unsigned int);
00093   itkSetMacro(Direction, unsigned int);
00094   itkGetConstMacro(Direction, unsigned int);
00096 
00099   void SetUseImageSpacingOn()
00100   { this->SetUseImageSpacing(true); }
00101 
00104   void SetUseImageSpacingOff()
00105   { this->SetUseImageSpacing(false); }
00106 
00109   itkSetMacro(UseImageSpacing, bool);
00110   itkGetConstMacro(UseImageSpacing, bool);
00112 
00120   virtual void GenerateInputRequestedRegion()
00121   throw( InvalidRequestedRegionError );
00122 
00123 protected:
00124   DerivativeImageFilter()
00125   {
00126     m_Order = 1;
00127     m_Direction = 0;
00128     m_UseImageSpacing = true;
00129   }
00130 
00131   virtual ~DerivativeImageFilter() {}
00132   void PrintSelf(std::ostream & os, Indent indent) const;
00133 
00139   void GenerateData();
00140 
00141 private:
00142   DerivativeImageFilter(const Self &); //purposely not implemented
00143   void operator=(const Self &);        //purposely not implemented
00144 
00146   unsigned int m_Order;
00147 
00149   unsigned int m_Direction;
00150 
00151   bool m_UseImageSpacing;
00152 };
00153 } // end namespace itk
00154 
00155 #ifndef ITK_MANUAL_INSTANTIATION
00156 #include "itkDerivativeImageFilter.hxx"
00157 #endif
00158 
00159 #endif
00160