20 #ifndef MIRTK_TransformationModel_H 21 #define MIRTK_TransformationModel_H 23 #include "mirtk/String.h" 24 #include "mirtk/Array.h" 25 #include "mirtk/ImageAttributes.h" 26 #include "mirtk/TransformationType.h" 71 default: str =
"Unknown";
break;
80 case TM_Rigid:
return "rigid transformation";
82 case TM_Affine:
return "affine transformation";
83 case TM_LinearFFD:
return "non-parametric displacement field";
86 case TM_BSplineSVFFD:
return "parametric stationary velocity field transformation";
87 case TM_BSplineTDFFD:
return "temporal diffeomorphic free-form deformation";
88 default:
return "unknown transformation";
121 inline bool IsLinear(
const Array<TransformationModel> &model)
123 for (
size_t i = 0; i < model.size(); ++i) {
124 if (
IsLinear(model[i]))
return true;
133 for (
size_t i = 0; i < model.size(); ++i) {
134 if (!
IsLinear(model[i]))
return true;
150 for (
size_t i = 0; i < model.size(); ++i) {
165 inline bool IsDiffeo(
const Array<TransformationModel> &model)
167 for (
size_t i = 0; i < model.size(); ++i) {
168 if (
IsDiffeo(model[i]))
return true;
184 for (
size_t i = 0; i < model.size(); ++i) {
206 if (domain.
_t == 1) {
208 case TM_LinearFFD:
return TRANSFORMATION_LINEAR_FFD_3D_v3;
215 case TM_LinearFFD:
return TRANSFORMATION_LINEAR_FFD_4D_v2;
222 case TM_Rigid:
return TRANSFORMATION_RIGID;
224 case TM_Affine:
return TRANSFORMATION_AFFINE;
228 default:
return TRANSFORMATION_UNKNOWN;
254 default: str =
"Unknown";
break;
264 else if (strcmp(str,
"None") == 0) m =
MFFD_None;
265 else if (strcmp(str,
"Sum") == 0) m =
MFFD_Sum;
266 else if (strcmp(str,
"LogSum") == 0) m =
MFFD_LogSum;
267 else if (strcmp(str,
"Fluid") == 0) m =
MFFD_Fluid;
275 #endif // MIRTK_RegistrationFilter_H Additive multi-level stationary velocity field.
Stationary velocity field with B-spline interpolation.
Number of available transformation models + 1.
bool IsLinear(TransformationModel model)
Whether a given transformation model is linear.
MFFDMode
Enumeration of available multi-level transformation modes.
Displacement field with B-spline interpolation using a statistical model.
string ToPrettyString(const EnergyMeasure &value, int w=0, char c=' ', bool left=true)
Convert energy measure enumeration value to human-friendly descriptive string.
Linear transformation with up to 6 DoFs (rotate, translate)
bool IsDiffeo(TransformationModel model)
Whether a given transformation model is diffeomorphic (velocity parameterization) ...
One transformation for each resolution level with fluid composition.
int _t
Image t-dimension (in voxels)
One transformation for each resolution level with additive composition.
Use single transformation without additional global or local transformations.
string ToString(const EnergyMeasure &value, int w, char c, bool left)
Convert energy measure enumeration value to string.
bool FromString(const char *str, EnergyMeasure &value)
Convert energy measure string to enumeration value.
bool IsLinearFFD(TransformationModel model)
Whether a given transformation model is a FFD with a linear interpolation kernel. ...
Non-stationary velocity field with B-spline interpolation.
Displacement field with B-spline interpolation.
Unknown/invalid transformation model.
Choose suitable default multi-level transformation model.
bool IsSpatioTemporal(TransformationModel model)
Whether a given transformation model is 3D+t.
Displacement field with linear interpolation.
TransformationType ToTransformationType(TransformationModel model, const ImageAttributes &domain)
Linear transformation with up to 12 DoFs (rotate, translate, scale, skew)
bool IsNonLinear(const Array< TransformationModel > &model)
Whether any given transformation model is non-linear.
Linear transformation with up to 7 DoFs (rotate, translate, global scale)