#include "eerio.h"
#include <tiffio.h>
#include <boost/property_tree/xml_parser.hpp>
Go to the source code of this file.
|
typedef vector< pair< int, int > > | COORDS |
|
◆ COORDS
typedef vector<pair<int, int> > COORDS |
◆ decode_eer_data()
Definition at line 48 of file eerio.cpp.
59 coords.push_back(decoder(count, sub_pix));
const unsigned int camera_size
vector< pair< int, int > > COORDS
References EMAN::Decoder::camera_size.
◆ parse_acquisition_data()
Dict parse_acquisition_data |
( |
string |
metadata | ) |
|
Definition at line 104 of file eerio.cpp.
106 std::istringstream ins(metadata);
111 for(
auto &v : pt.get_child(
"metadata")) {
112 auto xml_item_name = v.second.get_child(
"<xmlattr>.name").data();
113 auto xml_item_value = v.second.data();
117 dict[key] = xml_item_value;
Dict is a dictionary to store <string, EMObject> pair.
string to_snake_case(const string &s)
References to_snake_case().
Referenced by EMAN::EerIO::EerIO().
◆ read_acquisition_metadata()
string read_acquisition_metadata |
( |
TIFF * |
tiff | ) |
|
Definition at line 78 of file eerio.cpp.
79 char *metadata_c =
nullptr;
82 TIFFSetDirectory(tiff, 0);
83 TIFFGetField(tiff, 65001, &count, &metadata_c);
85 return string(metadata_c, count);
Referenced by EMAN::EerIO::EerIO().
◆ read_compression()
auto read_compression |
( |
TIFF * |
tiff | ) |
|
Definition at line 123 of file eerio.cpp.
124 uint16_t compression = 0;
126 TIFFGetField(tiff, TIFFTAG_COMPRESSION, &compression);
◆ read_raw_data()
auto read_raw_data |
( |
TIFF * |
tiff | ) |
|
Definition at line 131 of file eerio.cpp.
132 auto num_strips = TIFFNumberOfStrips(tiff);
133 vector<unsigned int> strip_sizes(num_strips);
135 for(
size_t i=0; i<num_strips; ++i)
136 strip_sizes[i] = TIFFRawStripSize(tiff, i);
138 std::vector<unsigned char> data;
140 for(
size_t i=0; i<num_strips; ++i) {
141 auto prev_size = data.size();
142 data.resize(prev_size + strip_sizes[i]);
143 TIFFReadRawStrip(tiff, i, data.data() + prev_size, strip_sizes[i]);
◆ TIFFOutputWarning()
void TIFFOutputWarning |
( |
const char * |
module, |
|
|
const char * |
fmt, |
|
|
va_list |
ap |
|
) |
| |
◆ to_snake_case()
string to_snake_case |
( |
const string & |
s | ) |
|
Definition at line 88 of file eerio.cpp.
91 for(
int i=0; i<s.size(); i++) {
93 if(!isupper(s[i-1])) {
94 ret.insert(i + sh,
"_");
97 ret[i + sh] = ::tolower(s[i]);
Referenced by parse_acquisition_data().