aimstil  5.0.5
neighborhoodTools.h
Go to the documentation of this file.
1 #ifndef TIL_NEIGHBORHOOD_TOOLS
2 #define TIL_NEIGHBORHOOD_TOOLS
3 
4 // includes from STL
5 #include <vector>
6 
7 // includes from TIL library
8 #include "til/Neighborhood.h"
9 #include "til/numeric_array.h"
10 
11 
12 // Namespace
13 namespace til
14 {
15 
16  // Keep only 'past' neighbord in the neighborhood.
17  // i.e. the connectivity used by a forward filter (say
18  // a connected component filter).
19  TIL_API void forwardize(Neighborhood & nh);
20 
21 
25  TIL_API void getNeighbors(const Neighborhood &nh, std::vector<numeric_array<int,3> > & res);
26 
27 
28  // Returns the connectivity of the neighborhood.
29  TIL_API int connectivity(const Neighborhood & nh);
30 
31 
32  // Creates a 2D neighborhood in 3D, orthogonal to the vector (nx, ny, nz)
33  // The normal (nx, ny, nz) should be binary, i.e. each componant should
34  // be either 0 or one
35  // A certain connectivity can be required. If set to 0, then maximal connectivity
36  // is assumed
37  TIL_API void create2DNeighborhood(Neighborhood & nh, int nx, int ny, int nz, int connectivity = 0);
38 
39 
40 } // namespace til
41 
42 #endif
43 
44 
45 
Belongs to package Box Do not include directly, include til/Box.h instead.
Definition: Accumulator.h:10
TIL_API void forwardize(Neighborhood &nh)
TIL_API void getNeighbors(const Neighborhood &nh, std::vector< numeric_array< int, 3 > > &res)
Pushes the neighbor coordinates in a container.
#define TIL_API
Definition: til_common.h:42
TIL_API int connectivity(const Neighborhood &nh)
TIL_API void create2DNeighborhood(Neighborhood &nh, int nx, int ny, int nz, int connectivity=0)