/vol/vipdata/irtk/image++/include/irtkLargestConnectedComponent.h

00001 /*=========================================================================
00002 
00003   Library   : Image Registration Toolkit (IRTK)
00004   Module    : $Id: irtkLargestConnectedComponent.h 2 2008-12-23 12:40:14Z dr $
00005   Copyright : Imperial College, Department of Computing
00006               Visual Information Processing (VIP), 2008 onwards
00007   Date      : $Date: 2008-12-23 12:40:14 +0000 (Tue, 23 Dec 2008) $
00008   Version   : $Revision: 2 $
00009   Changes   : $Author: dr $
00010 
00011 =========================================================================*/
00012 
00013 #ifndef _IRTKLARGESTCONNECTEDCOMPONENT_H
00014 
00015 #define _IRTKLARGESTCONNECTEDCOMPONENT_H
00016 
00017 #include <irtkImageToImage.h>
00018 
00027 template <class VoxelType> class irtkLargestConnectedComponent : public irtkImageToImage<VoxelType>
00028 {
00029 
00031   int _currentClusterSize;
00032 
00034   int _largestClusterSize;
00035 
00037   VoxelType _ClusterLabel;
00038 
00040   Bool _Mode2D;
00041 
00042 protected:
00043 
00045   void Grow2D(int, int, int, int);
00046 
00048   void Grow3D(int, int, int, int);
00049 
00051   virtual Bool RequiresBuffering();
00052 
00054   virtual const char *NameOfClass();
00055 
00056 public:
00057 
00059   irtkLargestConnectedComponent(VoxelType = 0);
00060 
00062   ~irtkLargestConnectedComponent();
00063 
00065   SetMacro(ClusterLabel, VoxelType);
00066 
00068   GetMacro(ClusterLabel, VoxelType);
00069 
00071   SetMacro(Mode2D, Bool);
00072 
00074   GetMacro(Mode2D, Bool);
00075 
00077   virtual void Run();
00078 
00079 };
00080 
00081 #endif