35 #ifndef AIMS_TOPOLOGY_TOPOLOGY_H
36 #define AIMS_TOPOLOGY_TOPOLOGY_H
61 template<
class T >
inline
69 template<
class T >
inline
72 if ( d->getBorders()[0] == 0 || d->getBorders()[1] == 0
73 || d->getBorders()[2] == 0 )
75 int dx = d->getSizeX(), dy = d->getSizeY(), dz = d->getSizeZ();
79 _data.setVoxelSize( d->getVoxelSize() );
81 for ( z=0; z<dz; z++ )
82 for ( y=0; y<dy; y++ )
83 for ( x=0; x<dx; x++ )
84 _data( x, y, z ) = d->at( x, y, z );
88 _data.fillBorder( (T)0 );
92 template<
class T >
inline
95 if ( pt[0] > 0 && pt[1] > 0 && pt[2] > 0 && pt[0] < _data.getSizeX()-1 &&
96 pt[1] < _data.getSizeY()-1 && pt[2] < _data.getSizeZ()-1 )
103 for (
int i=1; i<27; i++ )
105 dep = pt + connex26.deplacement( i );
106 *xptr++ = ( _data( dep ) == (T)label );
109 else _cstar = _cbar = 0;
113 template<
class T >
inline
116 if ( pt[0] > 0 && pt[1] > 0 && pt[2] > 0 && pt[0] < _data.getSizeX()-1 &&
117 pt[1] < _data.getSizeY()-1 && pt[2] < _data.getSizeZ()-1 )
125 for (
int i=1; i<27; i++ )
127 dep = pt + connex26.deplacement( i );
129 *xptr++ = ( temp == (T)lb1 ) || ( temp == (T)lb2 );
132 else _cstar = _cbar = 0;
136 template<
class T >
inline
139 if ( pt[0] > 0 && pt[1] > 0 && pt[2] > 0 && pt[0] < _data.getSizeX()-1 &&
140 pt[1] < _data.getSizeY()-1 && pt[2] < _data.getSizeZ()-1 )
147 for (
int i=1; i<27; i++ )
149 dep = pt + connex26.deplacement( i );
150 *xptr++ = ( _data( dep ) != (T)label );
153 else _cstar = _cbar = 0;
void fillNeighborhoodComplement(const Point3d &, int)
Topology(const carto::rc_ptr< carto::Volume< T > > &)
void fillNeighborhood(const Point3d &, int)