35 #ifndef AIMS_SCALESPACE_BUCKETBLOB_D_H
36 #define AIMS_SCALESPACE_BUCKETBLOB_D_H
47 : _stop( sc ), _merger( m ), _minima( minima ),
48 _keepallblobs( keepallblobs ),
72 std::map<int, int>::const_iterator im, em = bs.
mergemap.end();
73 std::set<int>::iterator notdone = blobs.end();
74 std::map<int, Point3d>::const_iterator notdead = bs.
deadblobs.end();
76 for( ib=bs.
blobs->begin(); ib!=eb; ++ib )
81 if( bs.
deadblobs.find( b ) == notdead && blobs.find( b ) == notdone )
83 if( ib->second.find( p + c.
xyzOffset(i) ) != ib->second.end() )
103 std::multimap<T, Point3d> orderedb;
106 for( ibk=bk.begin(); ibk!=ebk; ++ibk )
107 orderedb.
insert( std::pair<T, Point3d>( ibk->second, ibk->first ) );
109 typename std::multimap<T, Point3d>::iterator im, em = orderedb.end();
110 for( im=orderedb.begin(); im!=em; ++im )
112 const Point3d & p = im->second;
114 neighborBlobs( blobs, p, bs );
115 switch( blobs.size() )
122 (*bs.
blobs)[ *blobs.begin() ][ p ] =
Void();
125 _merger->merge( blobs, bs, p );
127 if( _stop->stops( p, bs ) )
137 std::map<int, int> trans;
138 std::map<int, int>::const_iterator
139 im, em = bs.
mergemap.end(), em2 = trans.end();
142 for( ib=bs.
blobs->begin(); ib!=eb; ++ib )
147 if( _stop->doesKeepBlob( b, bs ) )
149 im = trans.find( b );
158 (*res)[b].
insert( ib->second.begin(), ib->second.end() );
169 template <
typename T>
171 (
const std::set<Point3d, BucketMapLess> & toJoin )
177 template <
typename T>
184 template <
typename T>
189 std::set<Point3d, BucketMapLess> active = pointsToJoin;
190 std::set<Point3d, BucketMapLess>::iterator ip, ip2, ep = active.end();
191 std::map<int, int>::const_iterator im, em = bs.
mergemap.end();
193 for( ib=bs.
blobs->begin(); ib!=eb && !active.empty(); ++ib )
195 for( ip=active.begin(); ip!=ep; )
197 if( ib->second.find( *ip ) != ib->second.end() )
220 return active.empty();
224 template <
typename T>
228 return blob == mainblob;
233 template <
typename T>
239 template <
typename T>
244 std::set<int>::iterator i = blobs.begin(), e = blobs.end();
260 template <
typename T>
267 template <
typename T>
273 template <
typename T>
277 std::set<int>::iterator i, e = blobs.end();
278 for( i=blobs.begin(); i!=e; ++i )
void insert(const Point3d &pos, const T &item)
void setSizeXYZT(float sizex, float sizey, float sizez, float sizet)
void erase(const Point3d &pos)
std::map< Point3d, T, BucketMapLess > Bucket
const Point3d & xyzOffset(int n) const