35 addUsageLine(
"Validate an obtained volume from a set of class averages");
37 addParamsLine(
" -i <md_file> : Metadata file with input classes");
39 addParamsLine(
" [--sym <symfile=c1>] : Enforce symmetry in projections");
40 addParamsLine(
" [--numVols <N=5>] : Number of intermediate volumes to generate");
41 addParamsLine(
" [--numClasses <N=8>] : Number of classes to generate the intermediate volumes");
58 std::cout <<
"Input classes metadata : " <<
fnClasses << std::endl;
59 std::cout <<
"Number of intermediate volumes to generate : " <<
NVols << std::endl;
60 std::cout <<
"Number of classes to be used : " <<
NClasses << std::endl;
62 std::cout <<
"Symmetry for projections : " <<
fnSym << std::endl;
79 if (system(cmd.c_str())==-1)
84 double rot, tilt,
psi;
101 md.setRow(row, row.id());
111 float AngularSampling = 30;
116 if (system(cmd.c_str())==-1)
119 args=
formatString(
"-i %s -o %s --mask circular %d -v 0",fnVol.c_str(),fnVol.c_str(),
static_cast<int>(-xdim/2));
120 cmd=(
String)
"xmipp_transform_mask "+args;
121 if (system(cmd.c_str())==-1)
127 for (
int ind=0; ind<NProj; ind++)
130 args=
formatString(
"-i %s -o %s --sampling_rate %f --sym %s --method fourier 1 0.25 bspline --compute_neighbors --angular_distance -1 --experimental_images %s",fnVol.c_str(),fnGallery.c_str(),AngularSampling,
fnSym.c_str(),
fnAngles.c_str());
131 cmd=(
String)
"xmipp_angular_project_library "+args;
132 if (system(cmd.c_str())==-1)
135 args=
formatString(
"-i %s -o %s --ref %s --Ri 0 --Ro %f --max_shift %f --append",
fnAngles.c_str(),
fnAngles.c_str(),fnGallery.c_str(),xdim/2,xdim/20);
136 cmd=(
String)
"xmipp_angular_projection_matching "+args;
137 if (system(cmd.c_str())==-1)
141 cmd=(
String)
"xmipp_reconstruct_fourier "+args;
142 if (system(cmd.c_str())==-1)
145 args=
formatString(
"-i %s -o %s --mask circular %d -v 0",fnVol.c_str(),fnVol.c_str(),
static_cast<int>(-xdim/2));
146 cmd=(
String)
"xmipp_transform_mask "+args;
147 if (system(cmd.c_str())==-1)
153 cmd=(
String)
"xmipp_reconstruct_fourier "+args;
154 if (system(cmd.c_str())==-1)
157 args=
formatString(
"-i %s -o %s --mask circular %d -v 0",fnVol.c_str(),fnVol.c_str(),
static_cast<int>(-xdim/2));
158 cmd=(
String)
"xmipp_transform_mask "+args;
159 if (system(cmd.c_str())==-1)
162 args=
formatString(
"-i %s -o %s --select below 0 --substitute value 0 -v 0",fnVol.c_str(),fnVol.c_str());
163 cmd=(
String)
"xmipp_transform_threshold "+args;
164 if (system(cmd.c_str())==-1)
172 double rot, tilt,
psi, rot2, tilt2, psi2;
173 std::vector<double>
error;
177 std::stringstream ss;
183 for (
const auto& row : md)
195 ss.str(std::string());
201 for (
const auto& rowAux : auxMetadata)
207 error.push_back(distance);
212 double sum = std::accumulate(error.begin(), error.end(), 0.0);
213 double mean = sum / error.size();
214 double sq_sum = std::inner_product(error.begin(), error.end(), error.begin(), 0.0);
215 double stdev =
std::sqrt(sq_sum / error.size() - mean * mean);
217 std::cout << std::endl;
218 std::cout <<
"stdev of errors : " << stdev << std::endl;
219 std::cout <<
"mean of errors : " << mean << std::endl;
227 std::stringstream ss;
243 ss.str(std::string());
250 ss.str(std::string());
255 ss.str(std::string());
262 tempSampling+=
"_sampling.xmd";
Just to locate unclassified errors.
void addAndQuery(MDQuery &query)
#define REPORT_ERROR(nerr, ErrormMsg)
void sqrt(Image< double > &op)
void defineParams()
Read arguments from command line.
FileName removeAllExtensions() const
void modifyAngles()
Modified angles.
const char * getParam(const char *param, int arg=0)
void readParams()
Read arguments from command line.
void eq(Image< double > &op1, const Image< double > &op2)
Be careful with integer images for relational operations...due to double comparisons.
T Euler_distanceBetweenAngleSets(T rot1, T tilt1, T psi1, T rot2, T tilt2, T psi2, bool only_projdir)
int verbose
Verbosity level.
TYPE distance(struct Point_T *p, struct Point_T *q)
void produceSideinfo()
Produce side info: fill arrays with relevant transformation matrices.
double psi(const double x)
String formatString(const char *format,...)
void reconstruct()
Reconstruct volume with all projections.
void addUsageLine(const char *line, bool verbatim=false)
unsigned int randomize_random_generator()
int getIntParam(const char *param, int arg=0)
void addParamsLine(const String &line)
void evaluate()
Modified angles.