Read projection parameters from a file. An exception is thrown if the file is not found or any of the parameters is not found in the right place.
226 MD.
read(fn_proj_param);
234 (
String)
"Prog_Project_Parameters::read: There is a problem " 235 "opening the file " + fn_proj_param);
237 std::vector <double> ParamVec;
252 "file " +
fn_angle +
" doesn't exist");
266 if (ParamVec.size() == 1)
282 RandChar =
new char[RandStr.length() + 1];
283 strcpy(RandChar, RandStr.c_str());
288 if (ParamVec.size() == 1)
304 RandChar =
new char[RandStr.length() + 1];
305 strcpy(RandChar, RandStr.c_str());
310 if (ParamVec.size() == 1)
326 RandChar =
new char[RandStr.length() + 1];
327 strcpy(RandChar, RandStr.c_str());
337 if (ParamVec.size()<2)
348 if (ParamVec.size()<2)
359 if (ParamVec.size()<2)
370 if (ParamVec.size() < 2)
381 if (ParamVec.size() < 2)
397 if ((fh_param = fopen(fn_proj_param.c_str(),
"r")) == NULL)
399 (
String)
"Prog_Project_Parameters::read: There is a problem " 400 "opening the file " + fn_proj_param);
401 while (fgets(line, 200, fh_param) != NULL)
423 "file " +
fn_angle +
" doesn't exist");
429 if (strcmp(auxstr,
"NULL") != 0)
434 if (auxstr ==
nullptr)
460 if (auxstr ==
nullptr)
480 if (auxstr ==
nullptr)
500 if (auxstr !=
nullptr)
509 if (auxstr !=
nullptr)
518 if (auxstr !=
nullptr)
527 if (auxstr !=
nullptr)
536 if (auxstr !=
nullptr)
546 "couldn't read all parameters from file %s, only read %d lines", fn_proj_param.c_str(), lineNo));
bool enable_angle_range
Enable angle range mode (0 or 1)
char * firstWord(char *str)
int proj_Ydim
Projection Ydim.
double Ndev
Stddev of the noise that must be added to the definition of the angle.
#define REPORT_ERROR(nerr, ErrormMsg)
Angle_range psi_range
Psi angle range.
Angle_range tilt_range
Tilting angle range.
int samples
No. of samples.
int proj_Xdim
Projection Xdim.
double Npixel_avg
Bias to be applied to each pixel grey value */.
int translate_randomness(char *str)
double Ncenter_avg
Bias to apply to the image center.
FileName fn_angle
Document filename.
float textToFloat(const char *str)
Angle_range rot_range
Rotational angle range.
double angF
final angular value
double Ncenter_dev
Standard deviation of the image center.
File or directory does not exist.
double ang0
initial angular value
#define ANGLE_RANGE_DETERMINISTIC
bool isMetaData(bool failIfNotExists=true) const
double Navg
Mean of the noise that must be added to the definition of the angle.
String formatString(const char *format,...)
int textToInteger(const char *str)
char * firstToken(const char *str)
String nextToken(const String &str, size_t &i)
double Npixel_dev
Standard deviation of the noise to be added to each pixel grey value.