CFEL - ASG Software Suite
2.5.0
CASS
|
Functions | |
void | write (const std::string &filename, std::vector< float >::const_iterator data, const std::pair< int, int > &shape) |
write cbf file More... | |
void | read (const std::string &filename, std::string &headerstring, std::vector< float > &matrix, std::pair< int, int > &shape) |
read the cbf data into a linearized 2d array More... | |
void cass::CBF::read | ( | const std::string & | filename, |
std::string & | headerstring, | ||
std::vector< float > & | matrix, | ||
std::pair< int, int > & | shape | ||
) |
read the cbf data into a linearized 2d array
[in] | filename | the name of the cbf file to read |
[out] | headerstring | the complete header of the cbf file |
[out] | matrix | the output matrix, will be resized to fit the data |
[out] | shape | the shape of the matrix |
open file and determine filesize
create a buffer and copy the whole header to it
parse the header
read the matrix data
Definition at line 191 of file cbf_handle.hpp.
Referenced by jocassview::FileHandler::loadDataFromCBF(), cass::MultiFileInput::readEventData(), and cass::TxtParser::runthis().
|
inline |
write cbf file
filename | the filename to write the cbf to |
data | iterator to the data that should be written |
shape | the shape of the image |
cbf parameters:
create the cbf file
find out length of the compressed array:
write image header
write histogram data compress image using the byte offset method and save as octet stream
terminate image data part with the MIME footer
and pad last record of file with zeros:
Definition at line 35 of file cbf_handle.hpp.
References QString::fromStdString().
Referenced by cass::pp1500::aboutToQuit(), cass::pp1500::processEvent(), and jocassview::FileHandler::saveDataToCBF().