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

itkZeroCrossingBasedEdgeDetectionImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkZeroCrossingBasedEdgeDetectionImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-10-07 17:31:02 $
00007   Version:   $Revision: 1.18 $
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 __itkZeroCrossingBasedEdgeDetectionImageFilter_h
00018 #define __itkZeroCrossingBasedEdgeDetectionImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkFixedArray.h"
00022 #include "itkImage.h"
00023 
00024 
00025 namespace itk
00026 {
00027   
00069 template<class TInputImage, class TOutputImage>
00070 class ITK_EXPORT ZeroCrossingBasedEdgeDetectionImageFilter
00071   : public ImageToImageFilter<TInputImage, TOutputImage>
00072 {
00073 public:
00075   typedef ZeroCrossingBasedEdgeDetectionImageFilter     Self;
00076   typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
00077 
00079   typedef TInputImage  InputImageType;
00080   typedef TOutputImage OutputImageType;
00081 
00083   typedef SmartPointer<Self>        Pointer;
00084   typedef SmartPointer<const Self>  ConstPointer;
00085 
00087   typedef typename TInputImage::PixelType   InputImagePixelType;
00088   typedef typename TOutputImage::PixelType  OutputImagePixelType;
00089 
00091   itkNewMacro(Self);  
00092 
00094   typedef typename TOutputImage::RegionType OutputImageRegionType;
00095 
00097   itkTypeMacro(ZeroCrossingBasedEdgeDetectionImageFilter, ImageToImageFilter);
00098 
00100   itkStaticConstMacro(ImageDimension, unsigned int,
00101                       TInputImage::ImageDimension );
00102   itkStaticConstMacro(OutputImageDimension, unsigned int,
00103                       TOutputImage::ImageDimension );
00105 
00107   typedef FixedArray<double, itkGetStaticConstMacro(ImageDimension)> ArrayType;
00108 
00110   itkSetMacro(Variance, ArrayType);
00111   itkGetMacro(Variance, const ArrayType);
00112   itkSetMacro(MaximumError, ArrayType);
00113   itkGetMacro(MaximumError, const ArrayType);
00115 
00117   itkGetMacro(BackgroundValue, OutputImagePixelType);
00118   itkSetMacro(BackgroundValue, OutputImagePixelType);
00119   itkGetMacro(ForegroundValue, OutputImagePixelType);
00120   itkSetMacro(ForegroundValue, OutputImagePixelType);
00122 
00124   void SetVariance(const typename ArrayType::ValueType v)
00125     {
00126     m_Variance.Fill(v);
00127     }
00128 
00135   void SetMaximumError(const typename ArrayType::ValueType v)
00136     {
00137     m_MaximumError.Fill(v);
00138     }
00139 
00140 #ifdef ITK_USE_CONCEPT_CHECKING
00141 
00142   itkConceptMacro(OutputEqualityComparableCheck,
00143     (Concept::EqualityComparable<OutputImagePixelType>));
00144   itkConceptMacro(SameDimensionCheck,
00145     (Concept::SameDimension<ImageDimension, OutputImageDimension>));
00146   itkConceptMacro(SameTypeCheck,
00147     (Concept::SameType<InputImagePixelType, OutputImagePixelType>));
00148   itkConceptMacro(OutputOStreamWritableCheck,
00149     (Concept::OStreamWritable<OutputImagePixelType>));
00150   itkConceptMacro(PixelTypeIsFloatingPointCheck,
00151     (Concept::IsFloatingPoint<InputImagePixelType>));
00152 
00154 #endif
00155 
00156 protected:
00157   ZeroCrossingBasedEdgeDetectionImageFilter()
00158     {
00159     m_Variance.Fill(1.0);
00160     m_MaximumError.Fill(0.01);
00161     m_BackgroundValue = NumericTraits<OutputImagePixelType>::Zero;
00162     m_ForegroundValue = NumericTraits<OutputImagePixelType>::One;
00163     }
00164   ~ZeroCrossingBasedEdgeDetectionImageFilter(){}
00165   ZeroCrossingBasedEdgeDetectionImageFilter(const Self&) {}
00166   void PrintSelf(std::ostream& os, Indent indent) const;
00167   
00174   void GenerateData();
00175 
00176 private:
00178   ArrayType m_Variance;
00179 
00182   ArrayType m_MaximumError;
00183 
00184   OutputImagePixelType m_BackgroundValue;
00185   OutputImagePixelType m_ForegroundValue;
00186 };
00187   
00188 } //end of namespace itk
00189 
00190 #ifndef ITK_MANUAL_INSTANTIATION
00191 #include "itkZeroCrossingBasedEdgeDetectionImageFilter.txx"
00192 #endif
00193   
00194 #endif
00195 

Generated at Thu Nov 6 01:06:36 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000