omni.register#

Functions for image registration.

Functions

grab_slice_encoding_dir(img)

Grabs the slice encoding direction axis from the Nifti image.

phase_corr_translate(target, source)

Does phase correlation to register images (Translation only).

realign4d(img, ref_idx, TR, slice_times, ...)

Wrapper for SpaceTimeRealign.

register(*args, **kwargs)

There is some kind of memory leak issue in the C++ backend that I can not seem to find...

register_main(target, interaction, source[, ...])

Main SynthTarget register routine.

tone_curve_adj(target, synth[, mask])

omni.register.grab_slice_encoding_dir(img: Nifti1Image)[source]#

Grabs the slice encoding direction axis from the Nifti image.

omni.register.phase_corr_translate(target: Nifti1Image, source: Nifti1Image) ndarray[source]#

Does phase correlation to register images (Translation only).

omni.register.realign4d(img: Nifti1Image, ref_idx: int, TR: float, slice_times: list, slice_encode_dir: int, loops: list = [1, 1, 1], speedup: list = [5, 3, 1], borders: list = [1, 1, 1]) Tuple[ndarray, Nifti1Image][source]#

Wrapper for SpaceTimeRealign.

omni.register.register(*args, **kwargs)[source]#

There is some kind of memory leak issue in the C++ backend that I can not seem to find…

As a workaround, this just starts the registration routine in a separate python process so that it gets cleaned up after it’s done.

This also sends SIGKILL to the job if the user inputs Ctrl+C to the main process. TODO: Gracefully handle SIGINT calls

omni.register.register_main(target, interaction, source, regress_mask=None, target_mask=None, source_mask=None, initial_affine=None, output=None, regressed_output=None, blurred_regressed_output=None, aligned_output=None, err_tol=0.0001, step_size=0.001, max_iterations=200, num_params=12, optimizer='gd', saturate=False, equalize=False, fixed_regress=False, no_register=False, output_intmat=False, sigma=0, bandwidth=0, tone_curve=False, tone_curve_mask=None)[source]#

Main SynthTarget register routine.

TODO: This is a mess of a function… Need to clean it up.