nifreeze.analysis.registration module¶
Accuracy and time of registration on a phantom with known motion.
Each moved volume of a perturbed copy is registered to three fixed images, and the estimated transform is compared with the truth from the copy’s sidecar: the head’s motion, from the b=0’s frame to the volume’s (fixed to moving, as the estimator reports it).
oracleThe noise-free reference volume of the same gradient direction, at the true position: the error of registration alone.
unmovedThe model’s held-out prediction from the reference: registration on a model’s target that motion has not corrupted.
movedThe model’s held-out prediction from the copy itself, as in a run before any motion is corrected.
The three together separate the error of registration from that of the model. This
analysis is about registration; the sensitivity analysis
(nifreeze.analysis.sensitivity) involves none.
- class nifreeze.analysis.registration.AntsRegistration(self, workdir: 'Path | str', seed: 'int | None' = 12345, **settings: 'Any')[source]¶
Bases:
objectThe estimator’s ANTs path, as it runs today: files, nipype and
antsRegistration.Register in
workdirwith the estimator’s defaults.- Parameters:
workdir (
os.pathlike) – Where the images and transforms are written.seed (
int, optional) – Seed of ANTs’ random sampling.**settings – Further arguments of
_run_registration().
- nifreeze.analysis.registration.FIXED = ('oracle', 'unmoved', 'moved')¶
The fixed images each moved volume is registered to.
- nifreeze.analysis.registration.Register¶
the fixed-to-moving matrix (RAS).
- Type:
register(fixed, moving, affine, mask, index)
alias of
Callable[[ndarray,ndarray,ndarray,ndarray,int],ndarray]
- nifreeze.analysis.registration.registration_accuracy(register: Callable[[ndarray, ndarray, ndarray, ndarray, int], ndarray], clean: DWI, reference: DWI, moved: DWI, truth: dict[int, ndarray], model: str | Callable[[...], Any] | None = None, fixed: Iterable[str] = ('oracle', 'unmoved', 'moved'), **model_kwargs: Any) list[dict][source]¶
Register each moved volume to each fixed image and measure the error.
- Parameters:
clean (
DWI) – The noise-free reference, the source of theoracletargets.reference (
DWI) – The reference, with the noise ofmoved.moved (
DWI) – The perturbed copy.truth (
dict) – The true fixed-to-moving matrix of each volume registered, by index.model (
strorCallable, optional) – The model of theunmovedandmovedtargets (seeheld_out_predictions()); required unlessfixedis onlyoracle.**model_kwargs – Arguments for the model.
- Returns:
One row per volume and fixed image, with the volume’s
indexandshell, thefixedimage, themaxandmeandisplacement (mm) within the brain between the estimated and true transforms, and thesecondsthe registration took.- Return type: