20 #ifndef MIRTK_EnergyMeasure_H 21 #define MIRTK_EnergyMeasure_H 23 #include "mirtk/String.h" 129 case EM_JE: str =
"JE";
break;
130 case EM_CC: str =
"CC";
break;
131 case EM_MI: str =
"MI";
break;
132 case EM_NMI: str =
"NMI";
break;
133 case EM_SSD: str =
"SSD";
break;
134 case EM_CR_XY: str =
"CR_XY";
break;
135 case EM_CR_YX: str =
"CR_YX";
break;
136 case EM_LC: str =
"LC";
break;
137 case EM_K: str =
"K";
break;
138 case EM_ML: str =
"ML";
break;
140 case EM_NCC: str =
"NCC";
break;
141 case EM_CoVar: str =
"CoVar";
break;
142 case EM_PSNR: str =
"PSNR";
break;
146 case EM_FRE: str =
"FRE";
break;
192 default: str =
"Unknown";
205 case EM_JE: str =
"Joint entropy";
break;
206 case EM_CC: str =
"Normalized cross-correlation";
break;
207 case EM_MI: str =
"Mutual information";
break;
208 case EM_NMI: str =
"Normalized mutual information";
break;
209 case EM_SSD: str =
"Sum of squared differences";
break;
210 case EM_CR_XY: str =
"Correlation ratio C(X|Y)";
break;
211 case EM_CR_YX: str =
"Correlation ratio C(Y|X)";
break;
212 case EM_LC: str =
"Label consistency";
break;
213 case EM_K: str =
"Kappa statistic";
break;
214 case EM_ML: str =
"Maximum likelihood";
break;
215 case EM_NGF_COS: str =
"Cosine of normalized gradient field";
break;
216 case EM_NCC: str =
"(Local) Normalized cross-correlation";
break;
217 case EM_CoVar: str =
"Covariance";
break;
218 case EM_PSNR: str =
"Peak signal-to-noise ratio";
break;
222 case EM_FRE: str =
"Fiducial registration error";
break;
255 case EM_Sparsity: str =
"Sparsity constraint";
break;
259 case EM_SqLogDetJac: str =
"Squared logarithm of Jacobian determinant";
break;
260 case EM_NegDetJac: str =
"Negative Jacobian determinant penalty";
break;
268 default: str =
"Unknown energy term";
285 if (lstr ==
"mse") value =
EM_SSD;
286 else if (lstr ==
"meansquarederror") value =
EM_SSD;
287 else if (lstr ==
"mean squared error") value =
EM_SSD;
288 else if (lstr ==
"lcc") value =
EM_NCC;
289 else if (lstr ==
"lncc") value =
EM_NCC;
290 else if (lstr ==
"kappa") value =
EM_K;
291 else if (lstr ==
"correlation ratio xy" ||
292 lstr ==
"correlationratioxy") value =
EM_CR_XY;
293 else if (lstr ==
"correlation ratio" ||
294 lstr ==
"correlationratio" ||
295 lstr ==
"correlation ratio yx" ||
296 lstr ==
"correlationratioyx") value =
EM_CR_YX;
302 if (lstr ==
"fiducial error" || lstr ==
"fiducialerror" ||
303 lstr ==
"landmark error" || lstr ==
"landmarkerror" ||
304 lstr ==
"landmark registration error" || lstr ==
"landmarkregistrationerror") {
306 }
else if (lstr ==
"correspondence distance" || lstr ==
"correspondencedistance") {
323 else if (strcmp(str,
"Bending") == 0) value =
EM_Curvature;
324 else if (strcmp(str,
"SurfaceBending") == 0) value =
EM_Curvature;
325 else if (strcmp(str,
"SurfaceCurvature") == 0) value =
EM_Curvature;
351 if (lstr == pretty || lstr ==
TrimAll(pretty,
" -"))
break;
369 return std::hash<int>()(enum_value);
377 #endif // MIRTK_EnergyMeasure_H string Trim(const string &str, const string &what=" \\)
Minimize metric distortion.
Sparsity constraint based on l2-norm.
Local normalized cross-correlation.
Default sparsity constraint.
Quadratic fit of neighor to tangent plane distance.
Cosine of normalzed gradient field.
Gauss curvature constraint.
string TrimAll(const string &str, const string &what=" \\)
Mean squared deviation from given deformation.
Distance measure based on currents representation.
string ToPrettyString(const EnergyMeasure &value, int w=0, char c=' ', bool left=true)
Convert energy measure enumeration value to human-friendly descriptive string.
Implicit surface distance force.
Repels too close non-neighboring triangles.
Sparsity constraint based on l0-norm.
Inflate point set surface.
string ToLower(const string &)
Convert string to lowercase letters.
Fiducial registration error (FRE) measure.
Penalise negative Jacobian determinant.
Thin-plate spline bending energy.
Constant force in normal direction.
Point correspondence distance measure.
Minimize curvature of point set surface.
Normalized cross-correlation.
Stretching force (rest edge length)
Maximum curvature constraint.
Repels too close non-neighboring nodes.
Squared logarithm of the Jacobian determinant.
Sum of squared differences.
string ToString(const EnergyMeasure &value, int w, char c, bool left)
Convert energy measure enumeration value to string.
Normalized mutual information.
bool FromString(const char *str, EnergyMeasure &value)
Convert energy measure string to enumeration value.
EnergyMeasure
Enumeration of all available energy terms.
Mean curvature constraint.
Unknown/invalid energy term.
Sparsity constraint based on l1-norm.
Distance measure based on varifold representation.
Volume preservation constraint.
Peak signal-to-noise ratio.
Topology preservation constraint.
Number of enumeration values + 1.