00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00117
00118 return typeid(InputPixelType) == typeid(unsigned char)
00119 || typeid(InputPixelType) == typeid(signed char)
00120
00121
00122 || typeid(InputPixelType) == typeid(bool);
00123 }
00124
00125
00126 virtual HistogramType * NewHistogram();
00127
00128 private:
00129 RankImageFilter(const Self&);
00130 void operator=(const Self&);
00131
00132 float m_Rank;
00133
00134 };
00135
00136 }
00137
00138 #ifndef ITK_MANUAL_INSTANTIATION
00139 #include "itkRankImageFilter.txx"
00140 #endif
00141
00142 #endif
00143