unravel.warp.to_fixed module#

Use warp_to_fixed (w2f) from UNRAVEL to forward warp a moving image (e.g., from atlas space) to fixed image space (e.g., tissue space) and remove padding from the warped image.

Note

  • Run this from the folder containing reg_outputs.

  • This script is for warping between different atlas spaces and removing padding from warped images.

  • For warping to/from atlas space and registration input space and maintaining padding in registration space, use warp.

  • For warping from atlas space to full resolution tissue space, use to_native.

Usage:#

warp_to_fixed -f reg_inputs/autofl_50um_masked.nii.gz -m path/moving_img.nii.gz -o path/warped_img.nii.gz [-ro reg_outputs] [-fri autofl_50um_masked_fixed_reg_input.nii.gz] [-inp multiLabel] [-v]

unravel.warp.to_fixed.parse_args()[source]#
unravel.warp.to_fixed.calculate_padded_dimensions(original_dimensions, pad_percent=0.25)[source]#
unravel.warp.to_fixed.forward_warp(fixed_img_path, reg_outputs_path, fixed_reg_in, moving_img_path, interpol, output=None, pad_percent=0.25)[source]#

Warp image from atlas space to tissue space (fixed image space).

Steps:
  1. Warp the moving image to fixed image space using the transformations from reg_outputs.

  2. Crop the warped image to remove padding based on the original dimensions of the fixed image and the padding percentage used during registration.

  3. Save the cropped image as .nii.gz with the same data type as the moving image.

unravel.warp.to_fixed.main()[source]#