unravel.warp.warp module#
Use warp
from UNRAVEL to warp to/from atlas space and registration input space
- Prereq:
reg
Note
This warps padded images in ./reg_outputs (i.e., images that match the padded fixed reg input). For unpadded final images, use
warp_to_fixed
andwarp_to_atlas
.
Usage for forward warping atlas to tissue space:#
warp -m atlas_img.nii.gz -f reg_outputs/autofl_50um_masked_fixed_reg_input.nii.gz -o native_space/atlas_in_tissue_space.nii.gz -inp multiLabel [-ro reg_outputs] [-v]
Usage for inverse warping tissue to atlas space:#
warp -m reg_outputs/autofl_50um_masked_fixed_reg_input.nii.gz -f atlas_img.nii.gz -o atlas_space/tissue_in_atlas_space.nii.gz -inv [–inp bSpline] [-ro reg_outputs] [-v]
- unravel.warp.warp.warp(reg_outputs_path, moving_img_path, fixed_img_path, output_path, inverse, interpol)[source]#
Applies the transformations to an image using ANTsPy.
Parameters:#
reg_outputs_path (Path): Path to the reg_outputs folder (contains transformation files) moving_img_path (str): Path to the image to be transformed. fixed_img_path (str): Path to the reference image for applying the transform. output_path (str): Path where the transformed image will be saved. inverse (bool): If True, apply the inverse transformation. Defaults to False. interpol (str): Type of interpolation (e.g., ‘Linear’, ‘NearestNeighbor’, etc.).
Notes:#
If multiLabel interpolation is used, the label values are rounded.
If bSpline interpolation is used, negative values are set to 0.