11 char const*
const SegPerfResults::m_ppchMeasureNameTable[eMesureLast] =
19 "RelativeVolumeError",
21 "ContourMeanDistance",
32 SegPerfResults::SegPerfResults()
36 m_fResTab[i] = std::numeric_limits<double>::quiet_NaN();
41 m_pchBaseOutputFileName =
new char[4+1];
48 SegPerfResults::SegPerfResults(std::string &pi_pchBaseFileName)
53 m_bResActiveTab[i] =
false;
56 if (pi_pchBaseFileName !=
"")
57 m_pchBaseOutputFileName = pi_pchBaseFileName;
74 printf(
"%s", m_ppchMeasureNameTable[i]);
75 for (
int j=0; j<(20-strlen(m_ppchMeasureNameTable[i])); ++j)
83 if (m_bResActiveTab[i])
84 iRest = printf(
"%f", m_fResTab[i]);
86 for (
int j=0; j<(20-iRest); ++j)
105 std::string outFileName = m_pchBaseOutputFileName +
".txt";
106 fOut = fopen(outFileName.c_str(),
"wb");
112 if (m_bResActiveTab[i])
113 bRes &= fprintf(fOut,
"%f;\t", m_fResTab[i])>0;
115 bRes &= fprintf(fOut,
";\t")>0;
117 bRes &= fprintf(fOut,
"\r\n")>0;
128 std::string outFileName = m_pchBaseOutputFileName +
".xml";
129 fOut = fopen(outFileName.c_str(),
"wb");
133 char *tmpStr = const_cast <
char *> (m_pchBaseOutputFileName.c_str());
134 char *pchImgName = strrchr(tmpStr,
'/');
137 pchImgName = strrchr(tmpStr,
'\\');
147 fprintf(fOut,
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n");
148 fprintf(fOut,
"<image name=\"%s\">\r\n", pchImgName);
151 if (m_bResActiveTab[i])
152 fprintf(fOut,
"\t<measure name=\"%s\">%f</measure>\r\n", m_ppchMeasureNameTable[i], m_fResTab[i]);
154 fprintf(fOut,
"</image>\r\n");
176 m_bResActiveTab[pi_eVal] = !m_bResActiveTab[pi_eVal];
177 bRes = m_bResActiveTab[pi_eVal];
189 return m_ppchMeasureNameTable;
bool save()
It saves results on text file or xml file in function of class default settings.
~SegPerfResults()
Destructor.
static char const *const *const getMeasureNameTable()
Get the list of all Measures available.
bool activeMeasurementOutput(eMesureName pi_eVal)
It active the saving of one specific measure. If it set twice time the effect is inverted.