 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
46 if ( filename.
length() < 1 ) {
47 cerr <<
"No filenames given to create a project!" << endl;
54 cout <<
"DEBUG read_project_serialem: reading " << filename << endl;
60 cout <<
"Reading " << filename << endl;
61 cout <<
"Number of sections: " << root[
"Sections"].
size() << endl;
74 cout <<
"DEBUG read_project_serialem: path " << path << endl;
76 imgfile = root[
"ImageFile"].
value();
81 if ( access(imgfile.
c_str(), R_OK) )
82 imgfile = path +
"/" + imgfile;
84 double volt = root[
"Voltage"].
real();
85 double Cs(2.0), amp(0.07);
87 JSvalue& sections = root[
"Sections"];
94 for (
auto it = sections.
begin(); it != sections.
end(); ++it ) {
97 if ( obj.
exists(
"ZValue") ) {
98 img_num = obj[
"ZValue"].
integer();
99 if ( obj.
exists(
"SubFramePath") ) {
100 imgfile = obj[
"SubFramePath"].
value();
101 if ( imgfile.contains(
"/") ) imgfile = imgfile.post_rev(
'/');
102 if ( imgfile.contains(
"\\") ) imgfile = imgfile.post_rev(
'\\');
103 mg_id = imgfile.
base();
104 if ( access(imgfile.c_str(), R_OK) )
105 imgfile = path +
"/" + imgfile;
106 if ( access(imgfile.c_str(), R_OK) == 0 )
110 if ( access(imgfile.c_str(), R_OK) == 0 )
114 cerr <<
"Error: Image file " << imgfile <<
" not read!" << endl;
115 error_show(
"read_project_serialem", __FILE__, __LINE__);
120 if ( !field->
mg ) field->
mg = mg;
123 if ( obj.
exists(
"SubFramePath") ) {
131 if ( obj.
exists(
"PixelSpacing") )
138 if ( obj.
exists(
"MinMaxMean") ) {
139 JSvalue& mmm = obj[
"MinMaxMean"];
140 double sc = obj[
"CountsPerElectron"].
real();
147 cout <<
"Creating micrograph " << mg_id <<
", with " << p->
images() <<
" frames" << endl;
148 cout <<
"Pixel size: " << mg->
pixel_size << endl;
149 cout <<
"Origin: " << mg->
origin << endl;
151 cout <<
"Intensity: " << mg->
intensity << endl;
154 }
if ( obj.
exists(
"T") ) {
155 text = obj[
"T"].
value();
158 }
else if ( text.
contains(
"Tilt axis angle") ) {
160 axis_angle = (axis_angle - 90)*
M_PI/180.0;
185 cerr <<
"Error: Not implemented yet!" << endl;
int project_mg_tilt_to_matrix(Bproject *project)
Sets the matrix from the tilt and axis angles for each micrograph.
int project_sort_by_tilt(Bproject *project)
Sorts the micrographs in each field by tilt angle.
Converts between SerialEM MDOC files and a micrograph parameter file.
Bfield * field_add(Bfield **field, Bstring &field_id)
Adds a field-of-view parameter structure to a linked list.
int read_project_serialem(Bstring &filename, Bproject *project, int flag)
Creates a project structure using SerialEM MDOC parameters.
string base(string &filename)
int error_show(string message, string file, int line)
Displays the error with file and line reference.
Vector3< long > size() const
vector< JSvalue >::iterator begin()
Bimage * read_img(char *filename, int readdata, int img_select)
General driver function to read multiple image formats.
Header file for reading and writing micrograph parameters.
vector< JSvalue >::iterator end()
int slices_to_images()
Changes the slices in a 3D image into a set of 2D images.
General image parameter class.
Header file for image processing from micrograph structures.
int write_project_serialem(Bstring &filename, Bproject *project)
Creates SerialEM MDOC files from a project structure.
Header file for 2D and 3D image I/O.
Bmicrograph * micrograph_add(Bmicrograph **mg, Bstring &mg_id)
Adds a micrograph parameter structure to a linked list.
Header file for generalized linked list functions.
Vector3< double > pixel_size
void sampling(long nn, Vector3< double > u)
bool contains(const Bstring &s)
Header file for single particle image processing in Bsoft.