/vol/vipdata/irtk/image++/include/irtkLargestConnectedComponentIterative.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _IRTKLARGESTCONNECTEDCOMPONENTITERATIVE_H
00014
00015 #define _IRTKLARGESTCONNECTEDCOMPONENTITERATIVE_H
00016
00017 #include <irtkImageToImage.h>
00018
00029 template <class VoxelType> class irtkLargestConnectedComponentIterative : public irtkImageToImage<VoxelType>
00030 {
00031
00033 VoxelType _TargetLabel;
00034
00036 int _largestClusterSize;
00037
00038
00039 VoxelType _largestClusterLabel;
00040
00041
00042 int *_ClusterSizes;
00043
00044
00045 int _NumberOfClusters;
00046
00048 Bool _Mode2D;
00049
00050 Bool _AllClustersMode;
00051
00052 protected:
00053
00055 virtual void Run3D();
00056 virtual void Run2D();
00057
00058
00059 virtual void ResetMarks();
00060
00061 virtual void SelectLargestCluster();
00062
00063 int CheckAdjacency2D(VoxelType& markA, VoxelType& markB);
00064 int CheckAdjacency3D(VoxelType& markA, VoxelType& markB);
00065
00067 virtual Bool RequiresBuffering();
00068
00070 virtual const char *NameOfClass();
00071
00072 public:
00073
00075 irtkLargestConnectedComponentIterative(VoxelType = 0);
00076
00078 ~irtkLargestConnectedComponentIterative();
00079
00081 SetMacro(TargetLabel, VoxelType);
00082
00084 GetMacro(TargetLabel, VoxelType);
00085
00087 SetMacro(Mode2D, Bool);
00088
00090 GetMacro(Mode2D, Bool);
00091
00093 SetMacro(AllClustersMode, Bool);
00094
00096 GetMacro(AllClustersMode, Bool);
00097
00099 virtual void Run();
00100 };
00101
00102 #endif