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

itkRankImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkRankImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-08-08 22:26:45 $
00007   Version:   $Revision: 1.3 $
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 __itkRankImageFilter_h
00018 #define __itkRankImageFilter_h
00019 
00020 #include "itkMovingHistogramImageFilter.h"
00021 #include <list>
00022 #include <map>
00023 #include <set>
00024 #include "itkRankHistogram.h"
00025 #include "itkFlatStructuringElement.h"
00026 
00027 namespace itk {
00028 
00056 template<class TInputImage, class TOutputImage, class TKernel=FlatStructuringElement< ::itk::GetImageDimension<TInputImage>::ImageDimension > >
00057 class ITK_EXPORT RankImageFilter : 
00058     public MovingHistogramImageFilter<TInputImage, TOutputImage, TKernel, RankHistogram< ITK_TYPENAME TInputImage::PixelType > >
00059 {
00060 public:
00062   typedef RankImageFilter                            Self;
00063   typedef MovingHistogramImageFilter<TInputImage,TOutputImage, TKernel, RankHistogram< typename TInputImage::PixelType > >
00064                                                      Superclass;
00065   typedef SmartPointer<Self>                         Pointer;
00066   typedef SmartPointer<const Self>                   ConstPointer;
00067 
00069   itkNewMacro(Self);  
00070 
00072   itkTypeMacro(RankImageFilter, 
00073                MovingHistogramImageFilter);
00074 
00076   typedef TInputImage                                InputImageType;
00077   typedef TOutputImage                               OutputImageType;
00078   typedef typename TInputImage::RegionType           RegionType;
00079   typedef typename TInputImage::SizeType             SizeType;
00080   typedef typename TInputImage::IndexType            IndexType;
00081   typedef typename TInputImage::PixelType            PixelType;
00082   typedef typename TInputImage::OffsetType           OffsetType;
00083   typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00084   typedef typename TOutputImage::PixelType           OutputPixelType;
00085   typedef typename TInputImage::PixelType            InputPixelType;
00086 
00088   itkStaticConstMacro(ImageDimension, unsigned int,
00089                       TInputImage::ImageDimension);
00090 
00092   typedef TKernel KernelType;
00093 
00095   typedef typename KernelType::ConstIterator         KernelIteratorType;
00096 
00098   typedef typename KernelType::SizeType              RadiusType;
00099 
00100   itkSetMacro(Rank, float)
00101   itkGetMacro(Rank, float)
00102 
00103 protected:
00104   RankImageFilter();
00105   ~RankImageFilter() {};
00106 
00107   typedef RankHistogram<InputPixelType> HistogramType;
00108   
00109   typedef RankHistogramVec<InputPixelType, std::less< InputPixelType> > VHistogram;
00110   typedef RankHistogramMap<InputPixelType, std::less< InputPixelType>  > MHistogram;
00111   
00112   void PrintSelf(std::ostream& os, Indent indent) const;
00113   
00114   bool useVectorBasedHistogram()
00115     {
00116     // bool, short and char are acceptable for vector based algorithm: they do not require
00117     // too much memory. Other types are not usable with that algorithm
00118     return typeid(InputPixelType) == typeid(unsigned char)
00119       || typeid(InputPixelType) == typeid(signed char)
00120 //       || typeid(InputPixelType) == typeid(unsigned short)
00121 //       || typeid(InputPixelType) == typeid(signed short)
00122       || typeid(InputPixelType) == typeid(bool);
00123     }
00124 
00125 
00126   virtual HistogramType * NewHistogram();
00127 
00128 private:
00129   RankImageFilter(const Self&); //purposely not implemented
00130   void operator=(const Self&); //purposely not implemented
00131 
00132   float m_Rank;
00133 
00134 }; // end of class
00135 
00136 } // end namespace itk
00137   
00138 #ifndef ITK_MANUAL_INSTANTIATION
00139 #include "itkRankImageFilter.txx"
00140 #endif
00141 
00142 #endif
00143 

Generated at Sat Feb 28 13:22:26 2009 for ITK by doxygen 1.5.6 written by Dimitri van Heesch, © 1997-2000