37 #ifndef AIMS_IO_BCKMAPR_H
38 #define AIMS_IO_BCKMAPR_H
58 BckMapReader(
const std::string& name ) : _name(name), _itemr( 0 ) {}
63 {
delete _itemr; _itemr = ir; }
71 template<
class T>
inline
76 <<
"Warning : .bck single frame reading not implemented yet -\n"
77 <<
"reading whole bucket\n";
82 std::ifstream::off_type offset = buf;
85 bool ascii = ( hdr.
openMode() ==
"ascii" );
86 std::ifstream is( fname.c_str(), std::ios::in | std::ios::binary );
89 is.unsetf( std::ios::skipws );
108 uint32_t time=0, nitem=0;
109 int size = hdr.
dimT();
112 for(
int t=0; t<size; ++t )
116 carto::StreamUtil::skip( is );
126 sr->
read( is, time );
129 carto::StreamUtil::skip( is );
139 sr->
read( is, nitem );
153 for( uint32_t n=0; n<nitem; ++n )
155 posr->
read( is, pos );
156 ir->
read( is, item );
176 template<
class T>
inline
180 reader.
read( thing );
aims::BckMapReader< T > & operator>>(aims::BckMapReader< T > &reader, aims::BucketMap< T > &thing)
BucketMap objects can be read / written by BckMapReader / BckMapWriter, these IO classes operate on t...
void setItemReader(ItemReader< T > *ir)
void read(BucketMap< T > &thing, int frame=-1)
BckMapReader(const std::string &name)
An alternate, ordered, representation for buckets (voxels lists).
std::map< Point3d, T, BucketMapLess > Bucket
void setHeader(const aims::PythonHeader &hdr)
Default low-levels readers.
virtual ItemReader< T > * reader(const std::string &openmode="binar", bool bswap=false) const
Low-level "small item" reader, used by higher-level file readers.
virtual void read(std::istream &is, T &item) const
virtual ItemReader< T > * reader(const std::string &openmode="binar", bool bswap=false) const =0
static void launchErrnoExcept(const std::string &filename="")
#define AIMS_MAGIC_NUMBER
The class for EcatSino data write operation.