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

itkFastApproximateRankImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkFastApproximateRankImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-04-23 03:43:41 $
00007   Version:   $Revision: 1.6 $
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 
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   itkGetConstMacro(Rank, float);
00087 
00088 protected:
00089   FastApproximateRankImageFilter()
00090     {
00091     // to avoid valgrind warning
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&); //purposely not implemented
00107   void operator=(const Self&); //purposely not implemented
00108 
00109   float m_Rank;
00110 };
00111 
00112 }
00113 
00114 #endif
00115 

Generated at Fri Apr 16 18:17:49 2010 for ITK by doxygen 1.6.1 written by Dimitri van Heesch, © 1997-2000