unravel.register.affine_initializer module#
Run reg_affine_initializer
(rai
) from UNRAVEL to perform affine initialization using ANTsPy.
Note
This allows ants.affine_initializer() to be run as a seperate process during reg.
This process is killed after a time out.
This also allows for suppressing error messages.
Python usage:#
>>> import subprocess
>>> import os
>>> command = ['python', 'reg_affine_initializer', '-f', 'reg_outputs/autofl_50um_masked_fixed_reg_input.nii.gz', '-m', 'atlas/average_template_CCFv3_30um.nii.gz', '-o', 'reg_outputs/ANTsPy_init_tform.nii.gz', '-t', '10' ]
>>> with open(os.devnull, 'w') as devnull:
>>> subprocess.run(command, stderr=devnull)
Usage:#
reg_affine_initializer -f reg_outputs/autofl_50um_masked_fixed_reg_input.nii.gz -m atlas/average_template_CCFv3_30um.nii.gz -o reg_outputs/ANTsPy_init_tform.nii.gz [-t 10] [-v]
- unravel.register.affine_initializer.affine_initializer_wrapper(fixed_image_path, moving_image_path, reg_outputs_path, queue)[source]#