OpendTect-6_4  6.4
conncomponents.h
Go to the documentation of this file.
1 #ifndef conncomponents_h
2 #define conncomponents_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bo Zhang/Yuancheng Liu
9  Date: July 2012
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 
17 #include "algomod.h"
18 #include "factory.h"
19 
20 
21 template <class T> class Array2D;
22 template <class T> class Array2DSlice;
23 template <class T> class Array3D;
24 
25 class TaskRunner;
26 
34 {
35 public:
36 
37  ConnComponents(const Array2D<bool>&);
38  ~ConnComponents();
39 
40  void compute(TaskRunner* tr=0);
41 
42  int nrComponents() const;
43  const TypeSet<int>* getComponent(int compidx);
44  const Array2D<int>* getLabel() const { return label_; }
45  void trimCompBranches(TypeSet<int>& comp);
46  static void trimCompBranches(TypeSet<int>& comp,int sz1);
47  static void getCompSticks(TypeSet<int>& comp,int sz1,
48  int allowgapsz, int minsticksz,
49  TypeSet<TypeSet<int> >& sticks);
50  /*Will change comp, make copy before call this*/
51 
52  float overLapRate(int componentidx);
53  /*Minimum rate of all dimensions.*/
54 
55 protected:
56 
57  void classifyMarks(Array2D<int>& mark);
58  void setMark(Array2D<int>& r,int source,int newval);
59 
64 };
65 
66 
73 {
74 public:
75 
76  ConnComponents3D(const Array3D<bool>&);
77  ~ConnComponents3D();
78 
79  void compute(TaskRunner* tr=0);
80 
81  struct VPos {
82  VPos() : i(-1),j(-1),k(-1) {}
83  int i;int j;int k;
84  };
85  int nrComponents() const;
86  const ObjectSet<VPos>* getComponent(int compidx);
87  /*<Comp size is sorted descending. */
88 
89 protected:
90 
91  void addToComponent(
92  const TypeSet<TypeSet<TypeSet<int> > >& comps,
93  int sliceidx,int compidx,
94  TypeSet<TypeSet<unsigned char> >& usedcomps,
95  ObjectSet<VPos>& rescomp);
96 
100 };
101 
102 
103 #endif
const Array2D< bool > & input_
Definition: conncomponents.h:60
#define mExpClass(module)
Definition: commondefs.h:160
TypeSet< int > sortedindex_
Definition: conncomponents.h:99
ObjectSet< ObjectSet< VPos > > components_
Definition: conncomponents.h:98
Classify connected components of a binarized array 3D, components are sorted in size.
Definition: conncomponents.h:72
const Array3D< bool > & input_
Definition: conncomponents.h:97
Set of pointers to objects.
Definition: commontypes.h:32
TypeSet< int > sortedindex_
Definition: conncomponents.h:63
Array2D ( Subclass of ArrayND ) is a two dimensional array.
Definition: arraynd.h:131
Class that can execute a task.
Definition: task.h:169
Subclass of Array2D and ArrayNDSliceBase.
Definition: arrayndslice.h:88
TypeSet< TypeSet< int > > components_
Definition: conncomponents.h:62
Definition: conncomponents.h:81
Array2D< int > * label_
Definition: conncomponents.h:61
Classify connected components of a binarized array 2D, components are sorted in size. User could get the best quadratic fit for the component if needed.
Definition: conncomponents.h:33
int k
Definition: conncomponents.h:83
Array3D ( Subclass of ArrayND ) is a three dimensional array.
Definition: arraynd.h:153
VPos()
Definition: conncomponents.h:82
const Array2D< int > * getLabel() const
Definition: conncomponents.h:44

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019