ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkDiscreteGaussianDerivativeImageFilter.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 __itkDiscreteGaussianDerivativeImageFilter_h
00019 #define __itkDiscreteGaussianDerivativeImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 #include "itkImage.h"
00023 
00024 namespace itk
00025 {
00059 template< class TInputImage, class TOutputImage >
00060 class ITK_EXPORT DiscreteGaussianDerivativeImageFilter :
00061   public ImageToImageFilter< TInputImage, TOutputImage >
00062 {
00063 public:
00065   typedef DiscreteGaussianDerivativeImageFilter           Self;
00066   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00067   typedef SmartPointer< Self >                            Pointer;
00068   typedef SmartPointer< const Self >                      ConstPointer;
00069 
00071   itkNewMacro(Self);
00072 
00074   itkTypeMacro(DiscreteGaussianDerivativeImageFilter, ImageToImageFilter);
00075 
00077   typedef TInputImage  InputImageType;
00078   typedef TOutputImage OutputImageType;
00079 
00082   typedef typename TOutputImage::PixelType         OutputPixelType;
00083   typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
00084   typedef typename TInputImage::PixelType          InputPixelType;
00085   typedef typename TInputImage::InternalPixelType  InputInternalPixelType;
00086 
00089   itkStaticConstMacro(ImageDimension, unsigned int,
00090                       TOutputImage::ImageDimension);
00091 
00093   typedef FixedArray< double, itkGetStaticConstMacro(ImageDimension) > ArrayType;
00094 
00096   typedef FixedArray< unsigned int, itkGetStaticConstMacro(ImageDimension) > OrderArrayType;
00097 
00101   itkSetMacro(Order, OrderArrayType);
00102   itkGetConstMacro(Order, const OrderArrayType);
00104 
00111   itkSetMacro(Variance, ArrayType);
00112   itkGetConstMacro(Variance, const ArrayType);
00114 
00118   itkSetMacro(MaximumError, ArrayType);
00119   itkGetConstMacro(MaximumError, const ArrayType);
00121 
00124   itkGetConstMacro(MaximumKernelWidth, int);
00125   itkSetMacro(MaximumKernelWidth, int);
00127 
00137   itkSetMacro(InternalNumberOfStreamDivisions, unsigned int);
00138   itkGetConstMacro(InternalNumberOfStreamDivisions, unsigned int);
00139 
00144   void SetOrder(const typename OrderArrayType::ValueType v)
00145   {
00146     OrderArrayType a;
00147 
00148     a.Fill(v);
00149     this->SetOrder(a);
00150   }
00151 
00152   void SetVariance(const typename ArrayType::ValueType v)
00153   {
00154     ArrayType a;
00155 
00156     a.Fill(v);
00157     this->SetVariance(a);
00158   }
00159 
00160   void SetMaximumError(const typename ArrayType::ValueType v)
00161   {
00162     ArrayType a;
00163 
00164     a.Fill(v);
00165     this->SetMaximumError(a);
00166   }
00167 
00172   itkSetMacro(UseImageSpacing, bool);
00173   itkGetConstMacro(UseImageSpacing, bool);
00174   itkBooleanMacro(UseImageSpacing);
00176 
00180   itkSetMacro(NormalizeAcrossScale, bool);
00181   itkGetConstMacro(NormalizeAcrossScale, bool);
00182   itkBooleanMacro(NormalizeAcrossScale);
00184 
00185 #ifdef ITK_USE_CONCEPT_CHECKING
00186 
00187   itkConceptMacro( OutputHasNumericTraitsCheck,
00188                    ( Concept::HasNumericTraits< OutputPixelType > ) );
00189 
00191 #endif
00192 protected:
00193 
00194   DiscreteGaussianDerivativeImageFilter()
00195   {
00196     m_Order.Fill(1);
00197     m_Variance.Fill(0.0);
00198     m_MaximumError.Fill(0.01);
00199     m_MaximumKernelWidth = 32;
00200     m_UseImageSpacing = true;
00201     m_NormalizeAcrossScale = false;
00202     m_InternalNumberOfStreamDivisions = ImageDimension * ImageDimension;
00203   }
00204 
00205   virtual ~DiscreteGaussianDerivativeImageFilter() {}
00206   void PrintSelf(std::ostream & os, Indent indent) const;
00207 
00214   virtual void GenerateInputRequestedRegion()
00215   throw( InvalidRequestedRegionError );
00216 
00222   void GenerateData();
00223 
00224 private:
00225 
00226   DiscreteGaussianDerivativeImageFilter(const Self &); //purposely not
00227                                                        // implemented
00228   void operator=(const Self &);                        //purposely not
00229                                                        // implemented
00230 
00232   OrderArrayType m_Order;
00233 
00236   ArrayType m_Variance;
00237 
00241   ArrayType m_MaximumError;
00242 
00245   int m_MaximumKernelWidth;
00246 
00248   bool m_UseImageSpacing;
00249 
00251   bool m_NormalizeAcrossScale;
00252 
00255   unsigned int m_InternalNumberOfStreamDivisions;
00256 };
00257 } // end namespace itk
00258 
00259 #ifndef ITK_MANUAL_INSTANTIATION
00260 #include "itkDiscreteGaussianDerivativeImageFilter.hxx"
00261 #endif
00262 
00263 #endif
00264