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

itkBilateralImageFilter.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkBilateralImageFilter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/09/10 14:28:44 $ 00007 Version: $Revision: 1.13 $ 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 __itkBilateralImageFilter_h 00018 #define __itkBilateralImageFilter_h 00019 00020 #include "itkImageToImageFilter.h" 00021 #include "itkImage.h" 00022 #include "itkNeighborhoodIterator.h" 00023 #include "itkConstNeighborhoodIterator.h" 00024 #include "itkNeighborhood.h" 00025 00026 namespace itk 00027 { 00067 template <class TInputImage, class TOutputImage > 00068 class ITK_EXPORT BilateralImageFilter : 00069 public ImageToImageFilter< TInputImage, TOutputImage > 00070 { 00071 public: 00073 typedef BilateralImageFilter Self; 00074 typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass; 00075 typedef SmartPointer<Self> Pointer; 00076 typedef SmartPointer<const Self> ConstPointer; 00077 00079 itkNewMacro(Self); 00080 00082 itkTypeMacro(BilateralImageFilter, ImageToImageFilter); 00083 00085 typedef TInputImage InputImageType; 00086 typedef TOutputImage OutputImageType; 00087 00089 typedef typename Superclass::OutputImageRegionType OutputImageRegionType; 00090 00093 typedef typename TOutputImage::PixelType OutputPixelType; 00094 typedef typename TOutputImage::InternalPixelType OutputInternalPixelType; 00095 typedef typename NumericTraits<OutputPixelType>::RealType OutputPixelRealType; 00096 typedef typename TInputImage::PixelType InputPixelType; 00097 typedef typename TInputImage::InternalPixelType InputInternalPixelType; 00098 00101 itkStaticConstMacro(ImageDimension, unsigned int, 00102 TOutputImage::ImageDimension); 00103 00105 typedef ConstNeighborhoodIterator<TInputImage> 00106 NeighborhoodIteratorType ; 00107 00109 typedef 00110 Neighborhood<double, itkGetStaticConstMacro(ImageDimension)> KernelType; 00111 00113 typedef typename KernelType::Iterator KernelIteratorType ; 00114 typedef typename KernelType::ConstIterator KernelConstIteratorType ; 00115 00117 typedef 00118 Image<double, itkGetStaticConstMacro(ImageDimension)> GaussianImageType; 00119 00123 itkSetVectorMacro(DomainSigma, double, ImageDimension); 00124 itkSetVectorMacro(DomainSigma, float, ImageDimension); 00125 itkGetVectorMacro(DomainSigma, const double, ImageDimension); 00126 itkSetMacro(RangeSigma, double); 00127 itkGetMacro(RangeSigma, double); 00128 itkGetMacro(FilterDimensionality, unsigned int); 00129 itkSetMacro(FilterDimensionality, unsigned int); 00130 00133 void SetDomainSigma(const double v) 00134 { 00135 double vArray[ImageDimension]; 00136 for (unsigned int i = 0; i<ImageDimension; ++i) { vArray[i] = v; } 00137 this->SetDomainSigma(vArray); 00138 } 00139 00142 void SetDomainSigma(const float v) 00143 { 00144 double vArray[ImageDimension]; 00145 for (unsigned int i = 0; i<ImageDimension; ++i) { vArray[i] = static_cast<double>(v); } 00146 this->SetDomainSigma(vArray); 00147 } 00148 00152 itkSetMacro(NumberOfRangeGaussianSamples, unsigned long); 00153 itkGetMacro(NumberOfRangeGaussianSamples, unsigned long); 00154 00155 protected: 00158 BilateralImageFilter() 00159 { 00160 unsigned int i; 00161 for (i = 0; i < ImageDimension; i++) 00162 { 00163 m_DomainSigma[i] = 4.0f; 00164 } 00165 m_RangeSigma = 50.0f; 00166 m_FilterDimensionality = ImageDimension; 00167 m_NumberOfRangeGaussianSamples = 100; 00168 m_DynamicRange = 0.0; 00169 m_DynamicRangeUsed = 0.0; 00170 m_DomainMu = 2.5; // keep small to keep kernels small 00171 m_RangeMu = 4.0; // can be bigger then DomainMu since we only 00172 // index into a single table 00173 00174 } 00175 virtual ~BilateralImageFilter() {} 00176 void PrintSelf(std::ostream& os, Indent indent) const; 00177 00179 void BeforeThreadedGenerateData(); 00180 00183 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, 00184 int threadId); 00185 00192 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError); 00193 00194 00195 private: 00196 BilateralImageFilter(const Self&); //purposely not implemented 00197 void operator=(const Self&); //purposely not implemented 00198 00201 double m_RangeSigma; 00202 00205 double m_DomainSigma[ImageDimension]; 00206 00209 double m_DomainMu; 00210 double m_RangeMu; 00211 00213 unsigned int m_FilterDimensionality; 00214 00216 KernelType m_GaussianKernel; 00217 00219 unsigned long m_NumberOfRangeGaussianSamples; 00220 double m_DynamicRange; 00221 double m_DynamicRangeUsed; 00222 std::vector<double> m_RangeGaussianTable; 00223 }; 00224 00225 } // end namespace itk 00226 00227 #ifndef ITK_MANUAL_INSTANTIATION 00228 #include "itkBilateralImageFilter.txx" 00229 #endif 00230 00231 #endif

Generated at Sat Mar 31 02:14:13 2007 for ITK by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2000