itkFastApproximateRankImageFilter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkFastApproximateRankImageFilter_h
00019 #define __itkFastApproximateRankImageFilter_h
00020
00021 #include "itkMiniPipelineSeparableImageFilter.h"
00022 #include "itkRankImageFilter.h"
00023
00024 namespace itk {
00025
00037 template<class TInputImage, class TOutputImage>
00038 class ITK_EXPORT FastApproximateRankImageFilter :
00039 public MiniPipelineSeparableImageFilter<TInputImage, TOutputImage,
00040 RankImageFilter<TInputImage, TInputImage,
00041 FlatStructuringElement< ::itk::GetImageDimension<TInputImage>::ImageDimension > > >
00042 {
00043 public:
00045 typedef FastApproximateRankImageFilter Self;
00046 typedef MiniPipelineSeparableImageFilter<TInputImage, TOutputImage, RankImageFilter<TInputImage, TInputImage, FlatStructuringElement< ::itk::GetImageDimension<TInputImage>::ImageDimension > > >
00047 Superclass;
00048 typedef SmartPointer<Self> Pointer;
00049 typedef SmartPointer<const Self> ConstPointer;
00050
00052 itkNewMacro(Self);
00053
00055 itkTypeMacro(FastApproximateRankImageFilter,
00056 MiniPipelineSeparableImageFilter);
00057
00059 typedef TInputImage InputImageType;
00060 typedef typename TInputImage::RegionType RegionType;
00061 typedef typename TInputImage::SizeType SizeType;
00062 typedef typename TInputImage::IndexType IndexType;
00063 typedef typename TInputImage::PixelType PixelType;
00064 typedef typename TInputImage::OffsetType OffsetType;
00065 typedef typename Superclass::FilterType FilterType;
00066
00068 itkStaticConstMacro(ImageDimension, unsigned int,
00069 TInputImage::ImageDimension);
00070
00072 typedef typename TInputImage::SizeType RadiusType;
00073
00074 void SetRank( float rank )
00075 {
00076 if( m_Rank != rank )
00077 {
00078 m_Rank = rank;
00079 for (unsigned i = 0; i < TInputImage::ImageDimension - 1; i++)
00080 {
00081 this->m_Filters[i]->SetRank( m_Rank );
00082 }
00083 this->Modified();
00084 }
00085 }
00086 itkGetMacro(Rank, float);
00087
00088 protected:
00089 FastApproximateRankImageFilter()
00090 {
00091
00092 m_Rank = 0.0;
00093 this->SetRank( 0.5 );
00094 }
00095
00096 ~FastApproximateRankImageFilter() {}
00097
00098 void PrintSelf(std::ostream &os, Indent indent) const
00099 {
00100 Superclass::PrintSelf(os, indent);
00101 os << indent << "Rank: " << m_Rank << std::endl;
00102 }
00103
00104
00105 private:
00106 FastApproximateRankImageFilter(const Self&);
00107 void operator=(const Self&);
00108
00109 float m_Rank;
00110 };
00111
00112 }
00113
00114 #endif
00115