37 #ifndef AIMS_UTILITY_MERGE_H
38 #define AIMS_UTILITY_MERGE_H
61 template <
class T,
class U>
95 template <
class T,
class U>
105 template <
class T,
class U>
inline
110 ASSERT(data->getSizeX() ==
mask->getSizeX() &&
111 data->getSizeY() ==
mask->getSizeY() &&
112 data->getSizeZ() ==
mask->getSizeZ() &&
113 data->getSizeT() ==
mask->getSizeT() );
122 for (it1=res.
begin(),it2=
mask->begin();it1!=res.
end();it1++,it2++)
123 if (*it2) *it1 = (T)*it2;
126 for (it1=res.
begin(),it2=
mask->begin();it1!=res.
end();it1++,it2++)
127 if (*it2==_label) *it1 = (T)_value;
130 for (it1=res.
begin(),it2=
mask->begin();it1!=res.
end();it1++,it2++)
131 if (*it2) *it1 = (T)_value;
134 _value = res.
max() + 1;
135 for (it1=res.
begin(),it2=
mask->begin();it1!=res.
end();it1++,it2++)
136 if (*it2==_label) *it1 = (T)_value;
139 _value = res.
max() + 1;
140 for (it1=res.
begin(),it2=
mask->begin();it1!=res.
end();it1++,it2++)
141 if (*it2) *it1 = (T)_value;
The template class to merge data and byte label data.
U _label
Label to consider.
AimsMerge(merge_t type, T value=0, U label=0)
The programmer must provide a type of merging.
merge_t _type
Merging type.
carto::VolumeRef< T > operator()(const carto::rc_ptr< carto::Volume< T > > &data, const carto::rc_ptr< carto::Volume< U > > &mask)
Return the result of the merge of a data and a byte label data.
virtual ~AimsMerge()
Destructor does nothing.
VolumeRef< T > deepcopy() const
blitz::Array< T, Volume< T >::DIM_MAX >::const_iterator const_iterator
blitz::Array< T, Volume< T >::DIM_MAX >::iterator iterator
@ AIMS_MERGE_ONE_TO_MAXP1
@ AIMS_MERGE_ALL_TO_MAXP1
BucketMap< Void > * mask(const BucketMap< Void > &src, const BucketMap< Void > &m, bool intersect=true)
mask src object with m.