MIR.models.registration_utils
Model-level registration utilities (transformers and geometry).
Functions
|
Ensemble average of displacement fields or SVFs. :param fields: list of displacement fields, each (*vol, ndims) :param field_types: parallel list, 'svf' or 'disp' :param weights: list of floats or None (defaults to equal) :param nb_steps: number of integration steps for VecInt :param iters: number of iterations for fit_warp_to_svf. |
|
field: numpy or torch, shape (*vol, ndims) field_type: 'svf' (already velocity) | 'disp' (plain displacement) Returns v as numpy, shape (*vol, ndims) |
|
Fit a stationary‑velocity field v so that exp(v) ≈ given displacement field. Parameters mirror the original TF implementation. warp shape: (*vol_shape, ndims) (numpy array or torch tensor) Returns: v as a numpy array of same shape. |
|
Fast approximation to fit_warp_to_svf using coarse-to-fine fitting. |
|
Approximate inverse by: fit v, then integrate ‑v. |
|
Compute the Jacobian determinant of a displacement field. disp: (B, C, *vol_shape) tensor with C = spatial dims (2 or 3) Returns detJ: (B, 1, *vol_shape). |
Classes
|
3-D Affine Transformer :param mode: interpolation mode, 'bilinear' or 'nearest' |
|
N-D Spatial Transformer Obtained from https://github.com/voxelmorph/voxelmorph :param size: spatial size of the input tensor :param mode: interpolation mode, 'bilinear' or 'nearest' |
|
Integrates a vector field via scaling and squaring. |