unravel.warp.to_native module#

Use warp_to_native from UNRAVEL to warp an atlas space image to tissue space and scale to full resolution.

Prereq:
  • ./parameters/metadata.txt (from io_metadata)

Python usage:#

>>> import unravel.warp.to_native as to_native
>>> native_img = to_native(sample_path, reg_outputs, fixed_reg_in, moving_img_path, metadata_rel_path, reg_res, miracl, zoom_order, interpol, output=None)
>>> # native_img is an np.ndarray

Usage:#

warp_to_native -m <path/image_to_warp_from_atlas_space.nii.gz> [-o <path/native_image.zarr>] [-fri autofl_50um_masked_fixed_reg_input.nii.gz] [-i multiLabel] [-md parameters/metadata.txt] [-ro reg_outputs] [–reg_res 50] [-zo 0] [-mi] [-d list of paths] [-p sample??] [-v]

unravel.warp.to_native.parse_args()[source]#
unravel.warp.to_native.calculate_resampled_padded_dimensions(original_dimensions, xy_res, z_res, target_res=50, pad_fraction=0.15, miracl=False)[source]#
unravel.warp.to_native.scale_to_full_res(ndarray, full_res_dims, zoom_order=0)[source]#

Scale ndarray to match x, y, z dimensions provided as ndarray (order=0 is nearest-neighbor). Returns scaled ndarray.

unravel.warp.to_native.to_native(sample_path, reg_outputs, fixed_reg_in, moving_img_path, metadata_rel_path, reg_res, miracl, zoom_order, interpol, output=None)[source]#

Warp image from atlas space to tissue space and scale to full resolution

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