37 #ifndef AIMS_BUCKET_BUCKET_H
38 #define AIMS_BUCKET_BUCKET_H
57 template<
class T>
class BucketMap;
69 :
public std::map< int , std::list< AimsBucketItem<T> > >
72 typedef typename std::map<int, std::list<AimsBucketItem<T> > >
::iterator
77 typedef typename std::map<int, std::list<AimsBucketItem<T> > >
::key_type
107 inline const std::list< AimsBucketItem<T> >&
109 {
return find( n )->second; }
117 inline float sizeX()
const;
119 inline float sizeY()
const;
121 inline float sizeZ()
const;
123 inline float sizeT()
const;
135 inline void setSizeXYZT(
float sizex,
float sizey,
float sizez,
float sizet);
136 inline void setSizeXYZT(
const std::vector<float> & vsize );
152 std::ostream& operator << <> (std::ostream& out,
160 #ifndef DOXYGEN_HIDE_INTERNAL_CLASSES
183 template <
class T>
inline
185 { (*this)[0].push_front(item);
189 template <
class T>
inline
191 { (*this)[0].push_back(item);
195 template <
class T>
inline
197 { (*this)[0].pop_front();
201 template <
class T>
inline
203 { (*this)[0].pop_back();
207 template <
class T>
inline std::vector<float>
210 std::vector<float> vs;
211 _header.getProperty(
"voxel_size", vs );
212 while( vs.size() < 4 )
220 std::vector<float> vs;
221 _header.getProperty(
"voxel_size", vs );
230 std::vector<float> vs;
231 _header.getProperty(
"voxel_size", vs );
240 std::vector<float> vs;
241 _header.getProperty(
"voxel_size", vs );
250 std::vector<float> vs;
251 _header.getProperty(
"voxel_size", vs );
258 template <
class T>
inline
262 std::vector<float> vs;
263 _header.getProperty(
"voxel_size", vs );
264 while( vs.size() < 4 )
267 _header.setProperty(
"voxel_size", vs );
271 template <
class T>
inline
275 std::vector<float> vs;
276 _header.getProperty(
"voxel_size", vs );
277 while( vs.size() < 4 )
280 _header.setProperty(
"voxel_size", vs );
284 template <
class T>
inline
288 std::vector<float> vs;
289 _header.getProperty(
"voxel_size", vs );
290 while( vs.size() < 4 )
293 _header.setProperty(
"voxel_size", vs );
297 template <
class T>
inline
301 std::vector<float> vs;
302 _header.getProperty(
"voxel_size", vs );
303 while( vs.size() < 4 )
306 _header.setProperty(
"voxel_size", vs );
310 template <
class T>
inline
314 std::vector<float> vs(4);
319 _header.setProperty(
"voxel_size", vs );
323 template <
class T>
inline
326 std::vector<float> vs = vsize;
327 while( vs.size() < 4 )
329 _header.setProperty(
"voxel_size", vs );
333 template <
class T>
inline
337 for (it=this->begin();it!=this->end();it++)
338 ((*it).second).erase( ((*it).second).begin() , ((*it).second).end() );
339 std::map< int , std::list< AimsBucketItem<T> > >::erase( this->begin(), this->end() );
343 template <
class T>
inline
351 for (it1=thing.begin();it1!=thing.end();it1++)
354 out <<
"t=" << (*it1).first <<
",";
355 for (it2=((*it1).second).begin();it2!=((*it1).second).end();it2++)
360 return out <<
"NULL}" << std::flush;
AIMSDATA_API std::ostream & operator<<(std::ostream &out, const AimsBucket< T > &thing)
The template base class for all types of bucket items.
The bucket base class to manage packages of points associated to their value during time.
aims::PythonHeader & header()
float sizeX() const
returns the X resolution in mm
const std::list< AimsBucketItem< T > > & operator[](const key_type &n) const
AimsBucket(const AimsBucket< T > &other)
void setSizeX(float sizex)
sets the X resolution of the data in mm
float sizeY() const
returns the Y resolution in mm
std::map< int, std::list< AimsBucketItem< T > > >::const_iterator const_iterator
void setVoxelSize(float sizex, float sizey, float sizez, float sizet)
void push_back(const AimsBucketItem< T > &item)
void setVoxelSize(const std::vector< float > &vsize)
aims::PythonHeader _header
std::vector< float > getVoxelSize() const
void setSizeY(float sizey)
sets the Y resolution of the data in mm
void push_front(const AimsBucketItem< T > &item)
Function redefined to omit time.
float sizeZ() const
returns the Z resolution in mm
void setHeader(const aims::PythonHeader &hdr)
float sizeT() const
returns the T resolution in mm
void setSizeT(float sizet)
sets the T resolution of the data in mm
void setSizeXYZT(float sizex, float sizey, float sizez, float sizet)
sets X,Y,Z and T resolutions of the data in mm
AimsBucket< T > & operator=(const aims::BucketMap< T > &)
const aims::PythonHeader & header() const
std::map< int, std::list< AimsBucketItem< T > > >::key_type key_type
void erase()
Empty the whole map.
std::map< int, std::list< AimsBucketItem< T > > >::iterator iterator
void setSizeZ(float sizez)
sets the Z resolution of the data in mm
An alternate, ordered, representation for buckets (voxels lists).
static std::string dataType()
static std::string objectType()
static std::string name()
The class for EcatSino data write operation.