unravel.register.reg module#
Use reg
from UNRAVEL to register an average template brain/atlas to a resampled autofl brain.
- Prereqs:
reg_prep
, [seg_copy_tifs
], & [seg_brain_mask
]- Inputs:
template to register (e.g., gubra_template_CCFv3_30um.nii.gz, an iDISCO/LSFM template in CCFv3 space)
reg_inputs/autofl_50um_masked.nii.gz (from
reg_prep
)atlas/atlas_CCFv3_2020_30um.nii.gz (default; from Allen Brain Institute)
- Outputs:
reg_outputs/autofl_50um_masked_fixed_reg_input.nii.gz (padded fixed image used for registration with ANTsPy)
reg_outputs/<atlas>_in_tissue_space.nii.gz (warped atlas to tissue space for checking reg)
transformation matrices and deformation fields in reg_outputs
Note
Images in reg_inputs are not padded.
Images in reg_outputs have 25% padding by default.
If <template>_initial_alignment_to_fixed_img.nii.gz goes to the edge, increase padding (otherwise, region labels will be pulled out)
ort_code is a 3 letter orientation code of the fixed image if not set in fixed_img (e.g., RAS)
Letter options: A/P=Anterior/Posterior, L/R=Left/Right, S/I=Superior/Inferior
The side of the brain at the positive direction of the x, y, and z axes determines the 3 letters (axis order xyz)
- Next commands:
reg_check
for assessing registration,vstats_prep
for preparing voxel-wise stats inputs, orrstats
for regional stats.
Usage for tissue registration with brain mask and bias correction:#
reg -m <path/template.nii.gz> -bc -sm 0.4 -ort <3 letter orientation code> [-pad 0.25] [-m2 atlas/atlas_CCFv3_2020_30um.nii.gz] [-f reg_inputs/autofl_50um_masked.nii.gz] [-mas reg_inputs/autofl_50um_brain_mask.nii.gz] [-ro reg_outputs] [-d list of paths] [-p sample??] [-v]
Usage for tissue registration without brain mask and bias correction:#
reg -m <path/template.nii.gz> -f reg_inputs/autofl_50um.nii.gz -mas None -sm 0.4 -ort <orient code> [-pad 0.25] [-m2 atlas/atlas_CCFv3_2020_30um.nii.gz] [-ro reg_outputs] [-d list of paths] [-p sample??] [-v]
Usage for atlas to atlas registration:#
reg -m <path/atlas1.nii.gz> -f <path/atlas2.nii.gz> -m2 <path/atlas2.nii.gz> [-d list of paths] [-p sample??] [-v]
Usage for template to template registration:#
reg -m <path/template1.nii.gz> -f <path/template2.nii.gz> -m2 <path/template2.nii.gz> -inp linear [-d list of paths] [-p sample??] [-v]