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

itkMedianImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMedianImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-10-16 19:33:40 $
00007   Version:   $Revision: 1.7 $
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 __itkMedianImageFilter_h
00018 #define __itkMedianImageFilter_h
00019 
00020 
00021 // First make sure that the configuration is available.
00022 // This line can be removed once the optimized versions
00023 // gets integrated into the main directories.
00024 #include "itkConfigure.h"
00025 
00026 #ifdef ITK_USE_CONSOLIDATED_MORPHOLOGY
00027 #include "itkOptMedianImageFilter.h"
00028 #else
00029 
00030 #include "itkImageToImageFilter.h"
00031 #include "itkImage.h"
00032 
00033 namespace itk
00034 {
00054 template <class TInputImage, class TOutputImage>
00055 class ITK_EXPORT MedianImageFilter :
00056     public ImageToImageFilter< TInputImage, TOutputImage >
00057 {
00058 public:
00060   itkStaticConstMacro(InputImageDimension, unsigned int,
00061                       TInputImage::ImageDimension);
00062   itkStaticConstMacro(OutputImageDimension, unsigned int,
00063                       TOutputImage::ImageDimension);
00065 
00067   typedef TInputImage  InputImageType;
00068   typedef TOutputImage OutputImageType;
00069 
00071   typedef MedianImageFilter                                    Self;
00072   typedef ImageToImageFilter< InputImageType, OutputImageType> Superclass;
00073   typedef SmartPointer<Self>                                   Pointer;
00074   typedef SmartPointer<const Self>                             ConstPointer;
00075 
00077   itkNewMacro(Self);
00078 
00080   itkTypeMacro(MedianImageFilter, ImageToImageFilter);
00081 
00083   typedef typename InputImageType::PixelType  InputPixelType;
00084   typedef typename OutputImageType::PixelType OutputPixelType;
00085 
00086   typedef typename InputImageType::RegionType  InputImageRegionType;
00087   typedef typename OutputImageType::RegionType OutputImageRegionType;
00088 
00089   typedef typename InputImageType::SizeType InputSizeType;
00090 
00092   itkSetMacro(Radius, InputSizeType);
00093 
00095   itkGetConstReferenceMacro(Radius, InputSizeType);
00096 
00103   virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00104 
00105 #ifdef ITK_USE_CONCEPT_CHECKING
00106 
00107   itkConceptMacro(SameDimensionCheck,
00108                   (Concept::SameDimension<InputImageDimension, OutputImageDimension>));
00109   itkConceptMacro(InputConvertibleToOutputCheck,
00110                   (Concept::Convertible<InputPixelType, OutputPixelType>));
00111   itkConceptMacro(InputLessThanComparableCheck,
00112                   (Concept::LessThanComparable<InputPixelType>));
00113 
00115 #endif
00116 
00117 protected:
00118   MedianImageFilter();
00119   virtual ~MedianImageFilter() {}
00120   void PrintSelf(std::ostream& os, Indent indent) const;
00121 
00132   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00133                             int threadId );
00134 
00135 private:
00136   MedianImageFilter(const Self&); //purposely not implemented
00137   void operator=(const Self&); //purposely not implemented
00138 
00139   InputSizeType m_Radius;
00140 };
00141   
00142 } // end namespace itk
00143 
00144 #ifndef ITK_MANUAL_INSTANTIATION
00145 #include "itkMedianImageFilter.txx"
00146 #endif
00147 
00148 #endif
00149 
00150 #endif
00151 

Generated at Tue Sep 15 03:57:06 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000