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

itkMaskedRankImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMaskedRankImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-06-03 12:48:05 $
00007   Version:   $Revision: 1.5 $
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 __itkMaskedRankImageFilter_h
00018 #define __itkMaskedRankImageFilter_h
00019 
00020 #include "itkMaskedMovingHistogramImageFilter.h"
00021 #include <list>
00022 #include <map>
00023 #include <set>
00024 #include "itkMaskedRankHistogram.h"
00025 #include "itkFlatStructuringElement.h"
00026 
00027 namespace itk {
00028 
00056 template<class TInputImage, class TMaskImage, class TOutputImage, class TKernel=FlatStructuringElement< ::itk::GetImageDimension<TInputImage>::ImageDimension > >
00057 class ITK_EXPORT MaskedRankImageFilter : 
00058     public MaskedMovingHistogramImageFilter<TInputImage, TMaskImage, TOutputImage, TKernel, MaskedRankHistogram< ITK_TYPENAME TInputImage::PixelType > >
00059 {
00060 public:
00062   typedef MaskedRankImageFilter                      Self;
00063   typedef MaskedMovingHistogramImageFilter<TInputImage, TMaskImage, TOutputImage, TKernel, MaskedRankHistogram< typename TInputImage::PixelType > >
00064                                                      Superclass;
00065   typedef SmartPointer<Self>                         Pointer;
00066   typedef SmartPointer<const Self>                   ConstPointer;
00067 
00069   itkNewMacro(Self);  
00070 
00072   itkTypeMacro(MaskedRankImageFilter, 
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   itkGetConstMacro(Rank, float)
00102 
00103 protected:
00104   MaskedRankImageFilter();
00105   ~MaskedRankImageFilter() {};
00106 
00107   typedef MaskedRankHistogram<InputPixelType>        HistogramType;
00108   
00109   typedef MaskedRankHistogramVec<InputPixelType, std::less< InputPixelType> > VHistogram;
00110   typedef MaskedRankHistogramMap<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   MaskedRankImageFilter(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 "itkMaskedRankImageFilter.txx"
00140 #endif
00141 
00142 #endif
00143 

Generated at Mon Jul 12 2010 19:05:24 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000