38#ifndef YL_LABEL_VOLUME_HH_INCLUDED
39#define YL_LABEL_VOLUME_HH_INCLUDED
43#include <boost/iterator/transform_iterator.hpp>
45#include <cartodata/volume/volume.h>
46#include <aims/bucket/bucketMap.h>
52template<
typename TPair>
53class select1st :
public std::unary_function<TPair, typename TPair::first_type>
56 typename TPair::first_type&
62 const typename TPair::first_type&
70template <
typename Tlabel>
77 typedef boost::transform_iterator<select1st<BucketMap::value_type>,
80 typedef boost::transform_iterator<select1st<Bucket::value_type>,
91 return m_background_label;
101 return m_bucketmap.size();
121 assert(region_bucket_it != m_bucketmap.end());
122 return region_bucket_it->second.size();
129 assert(region_bucket_it != m_bucketmap.end());
138 assert(region_bucket_it != m_bucketmap.end());
144 const Tlabel m_background_label;
std::map< int, Bucket >::const_iterator const_iterator
std::map< Point3d, T, BucketMapLess > Bucket
const_point_iterator region_end(Tlabel label) const
Iterate through the coordinates of a region's voxels.
const_regions_iterator regions_end() const
Iterate through all region labels.
void discard_region(Tlabel label)
boost::transform_iterator< select1st< Bucket::value_type >, Bucket::const_iterator > const_point_iterator
Iterator through a Bucket's points (yields Point3d)
LabelVolume(const carto::VolumeRef< Tlabel > &vol, Tlabel background=0)
Tlabel background_label() const
aims::BucketMap< Void > BucketMap
const_point_iterator region_begin(Tlabel label) const
Iterate through the coordinates of a region's voxels.
const_regions_iterator regions_begin() const
Iterate through all region labels.
void merge_regions(Tlabel eating_label, Tlabel eaten_label)
BucketMap::size_type region_size(Tlabel label) const
boost::transform_iterator< select1st< BucketMap::value_type >, BucketMap::const_iterator > const_regions_iterator
const carto::VolumeRef< Tlabel > & volume() const
BucketMap::size_type n_regions() const
Return the first element of a std::pair, like non-standard std::select1st.
const TPair::first_type & operator()(const TPair &pair) const
TPair::first_type & operator()(TPair &pair) const