42 addUsageLine(
"+The program provides information about which class of classification 1 corresponds to which class of classification 2");
44 addParamsLine(
" --i1 <infile1> : Metadata with the classification 1");
45 addParamsLine(
" --i2 <infile2> : Metadata with the classification 2");
48 addExampleLine(
"xmipp_classify_compare_classes --i1 2D/CL2D/run_001/results_level_00_classes.xmd --i2 2D/CL2D/run_001/results_level_01_classes.xmd -o comparison_level_00_01.txt");
56 <<
"Input1: " <<
fnClass1 << std::endl
57 <<
"Input2: " <<
fnClass2 << std::endl
58 <<
"Output: " <<
fnOut << std::endl;
65 std::vector<int> ref1, ref2;
67 for (
size_t objId : MD1.
ids())
72 for (
size_t objId : MD2.
ids())
111 fhOut.open(
fnOut.c_str(),std::ios::app);
112 fhOut <<
"\n\n------------------------------------------------------------------------\n";
115 fhOut.open(
fnOut.c_str());
119 fhOut <<
"Analysis of " <<
fnClass1 <<
" =======================\n";
122 fhOut <<
"Class " <<
formatString(
"class%06d_images@%s",ref1[
i],fnClass1.c_str()) <<
": " <<
VEC_ELEM(MD1classSize,i) <<
" images\n";
127 fhOut <<
"\n\nAnalysis of " <<
fnClass2 <<
" =======================\n";
130 fhOut <<
"Class " <<
formatString(
"class%06d_images@%s",ref2[
j],fnClass2.c_str()) <<
": " <<
VEC_ELEM(MD2classSize,j) <<
" images\n";
133 fhOut <<
" " << 100.0*
MAT_ELEM(comparisonMatrix,
i,j)/
VEC_ELEM(MD2classSize,j) <<
"% are in class " <<
formatString(
"class%06d_images@%s",
i+1,fnClass1.c_str()) << std::endl;
void defineParams()
Define input parameters.
#define REPORT_ERROR(nerr, ErrormMsg)
Couldn't write to file.
#define MAT_ELEM(m, i, j)
#define FOR_ALL_ELEMENTS_IN_MATRIX1D(v)
const char * getParam(const char *param, int arg=0)
FileName fnClass1
Name of the two classification metadatas.
void addExampleLine(const char *example, bool verbatim=true)
int verbose
Verbosity level.
void readParams()
Read input parameters.
String formatString(const char *format,...)
bool checkParam(const char *param)
bool append
Append to output.
FileName fnOut
Name of the output text file.
void addUsageLine(const char *line, bool verbatim=false)
void addParamsLine(const String &line)