47 typedef std::list<Pt> Pset;
54 std::vector<int> bpos( 3, 1 );
59 T initVal = vol.
at( pos );
60 T minVal = initVal - tolerence;
61 T maxVal = initVal + tolerence;
62 std::cout <<
"minVal: " << minVal <<
", maxVal: " << maxVal << std::endl;
64 Pset *front = &front1, *next_front = &front2;
65 next_front->push_back( pos );
66 Connectivity c( &vol( 0, 1 ) - &vol( 0 ), &vol( 0, 0, 1 ) - &vol( 0 ),
71 Connectivity c2( &done( 0, 1 ) - &done( 0 ), &done( 0, 0, 1 ) - &done( 0 ),
74 while( !next_front->empty() )
77 std::cout <<
"front size: " << next_front->size() << std::endl;
83 Pset::const_iterator ip, ep = front->end();
85 for( ip=front->begin(); ip!=ep; ++ip )
90 int16_t *pd = &done.
at( p );
93 int16_t *ppd = pd + c2.
offset( i );
94 const T & val = *( pp + c.
offset( i ) );
95 if( *ppd == 0 && val >= minVal && val <= maxVal )
97 next_front->push_back( p + c.
xyzOffset( i ) );
Topology of a data container.
const Point3d & xyzOffset(int n) const
Get the X/Y/Z offsets of the nth element.
int nbNeighbors() const
Get the number of neighbors for that connectivity.
int offset(int n) const
Get the linear offset of the nth element.
Type
The different kinds of connectivity.
std::vector< int > getSize() const
const T & at(long x, long y=0, long z=0, long t=0) const
void fill(const T &value)
const T & at(long x, long y=0, long z=0, long t=0) const
The class for EcatSino data write operation.
void floodFill(carto::Volume< T > &vol, const Point3d &pos, T value, Connectivity::Type connectivity=Connectivity::CONNECTIVITY_18_XYZ, T tolerence=0, bool verbose=false)