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

itkDiscreteGaussianImageFilter.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkDiscreteGaussianImageFilter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/09/10 14:28:46 $ 00007 Version: $Revision: 1.31 $ 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 __itkDiscreteGaussianImageFilter_h 00018 #define __itkDiscreteGaussianImageFilter_h 00019 00020 #include "itkImageToImageFilter.h" 00021 #include "itkImage.h" 00022 00023 namespace itk 00024 { 00054 template <class TInputImage, class TOutputImage > 00055 class ITK_EXPORT DiscreteGaussianImageFilter : 00056 public ImageToImageFilter< TInputImage, TOutputImage > 00057 { 00058 public: 00060 typedef DiscreteGaussianImageFilter Self; 00061 typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass; 00062 typedef SmartPointer<Self> Pointer; 00063 typedef SmartPointer<const Self> ConstPointer; 00064 00066 itkNewMacro(Self); 00067 00069 itkTypeMacro(DiscreteGaussianImageFilter, ImageToImageFilter); 00070 00072 typedef TInputImage InputImageType; 00073 typedef TOutputImage OutputImageType; 00074 00077 typedef typename TOutputImage::PixelType OutputPixelType; 00078 typedef typename TOutputImage::InternalPixelType OutputInternalPixelType; 00079 typedef typename TInputImage::PixelType InputPixelType; 00080 typedef typename TInputImage::InternalPixelType InputInternalPixelType; 00081 00084 itkStaticConstMacro(ImageDimension, unsigned int, 00085 TOutputImage::ImageDimension); 00086 00092 itkSetVectorMacro(Variance, double, ImageDimension); 00093 itkSetVectorMacro(Variance, float, ImageDimension); 00094 itkGetVectorMacro(Variance, const double, ImageDimension); 00095 00099 itkSetVectorMacro(MaximumError, double, ImageDimension); 00100 itkSetVectorMacro(MaximumError, float, ImageDimension); 00101 itkGetVectorMacro(MaximumError, const double, ImageDimension); 00102 00105 itkGetMacro(MaximumKernelWidth, int); 00106 itkSetMacro(MaximumKernelWidth, int); 00107 00108 itkGetMacro(FilterDimensionality, unsigned int); 00109 itkSetMacro(FilterDimensionality, unsigned int); 00110 00113 void SetVariance(const double v) 00114 { 00115 double vArray[ImageDimension]; 00116 for (unsigned int i = 0; i<ImageDimension; ++i) { vArray[i] = v; } 00117 this->SetVariance(vArray); 00118 } 00119 void SetMaximumError(const double v) 00120 { 00121 double vArray[ImageDimension]; 00122 for (unsigned int i = 0; i<ImageDimension; ++i) { vArray[i] = v; } 00123 this->SetMaximumError(vArray); 00124 } 00125 00128 void SetVariance(const float v) 00129 { 00130 double vArray[ImageDimension]; 00131 for (unsigned int i = 0; i<ImageDimension; ++i) { vArray[i] = static_cast<double>(v); } 00132 this->SetVariance(vArray); 00133 } 00134 void SetMaximumError(const float v) 00135 { 00136 double vArray[ImageDimension]; 00137 for (unsigned int i = 0; i<ImageDimension; ++i) { vArray[i] = static_cast<double>(v); } 00138 this->SetMaximumError(vArray); 00139 } 00140 00144 void SetUseImageSpacingOn() 00145 { this->SetUseImageSpacing(true); } 00146 00149 void SetUseImageSpacingOff() 00150 { this->SetUseImageSpacing(false); } 00151 00154 itkSetMacro(UseImageSpacing, bool); 00155 itkGetMacro(UseImageSpacing, bool); 00156 00163 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError); 00164 00165 protected: 00166 DiscreteGaussianImageFilter() 00167 { 00168 unsigned int i; 00169 for (i = 0; i < ImageDimension; i++) 00170 { 00171 m_Variance[i] = 0.0f; 00172 m_MaximumError[i] = 0.01f; 00173 m_MaximumKernelWidth = 32; 00174 } 00175 m_UseImageSpacing = true; 00176 m_FilterDimensionality = ImageDimension; 00177 } 00178 virtual ~DiscreteGaussianImageFilter() {} 00179 void PrintSelf(std::ostream& os, Indent indent) const; 00180 00186 void GenerateData(); 00187 00188 00189 private: 00190 DiscreteGaussianImageFilter(const Self&); //purposely not implemented 00191 void operator=(const Self&); //purposely not implemented 00192 00194 double m_Variance[ImageDimension]; 00195 00199 double m_MaximumError[ImageDimension]; 00200 00203 int m_MaximumKernelWidth; 00204 00206 unsigned int m_FilterDimensionality; 00207 00209 bool m_UseImageSpacing; 00210 }; 00211 00212 } // end namespace itk 00213 00214 #ifndef ITK_MANUAL_INSTANTIATION 00215 #include "itkDiscreteGaussianImageFilter.txx" 00216 #endif 00217 00218 #endif

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