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: 2006/04/04 13:13:52 $
00007   Version:   $Revision: 1.15 $
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 
00130   void SetMaximumError(const typename ArrayType::ValueType v)
00131   {
00132     m_MaximumError.Fill(v);
00133   }
00134 
00135 #ifdef ITK_USE_CONCEPT_CHECKING
00136 
00137   itkConceptMacro(OutputEqualityComparableCheck,
00138     (Concept::EqualityComparable<OutputImagePixelType>));
00139   itkConceptMacro(SameDimensionCheck,
00140     (Concept::SameDimension<ImageDimension, OutputImageDimension>));
00141   itkConceptMacro(SameTypeCheck,
00142     (Concept::SameType<InputImagePixelType, OutputImagePixelType>));
00143   itkConceptMacro(OutputOStreamWritableCheck,
00144     (Concept::OStreamWritable<OutputImagePixelType>));
00145 
00147 #endif
00148 
00149 protected:
00150   ZeroCrossingBasedEdgeDetectionImageFilter()
00151   {
00152     m_Variance.Fill(1.0);
00153     m_MaximumError.Fill(0.01);
00154     m_BackgroundValue = NumericTraits<OutputImagePixelType>::Zero;
00155     m_ForegroundValue = NumericTraits<OutputImagePixelType>::One;
00156   }
00157   ~ZeroCrossingBasedEdgeDetectionImageFilter(){}
00158   ZeroCrossingBasedEdgeDetectionImageFilter(const Self&) {}
00159   void PrintSelf(std::ostream& os, Indent indent) const;
00160   
00167   void GenerateData();
00168 
00169 private:
00171   ArrayType m_Variance;
00172 
00175   ArrayType m_MaximumError;
00176 
00177   OutputImagePixelType m_BackgroundValue;
00178   OutputImagePixelType m_ForegroundValue;
00179 };
00180   
00181 } //end of namespace itk
00182 
00183 #ifndef ITK_MANUAL_INSTANTIATION
00184 #include "itkZeroCrossingBasedEdgeDetectionImageFilter.txx"
00185 #endif
00186   
00187 #endif
00188 
00189 

Generated at Mon Mar 12 03:34:07 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000