unravel.image_tools.resample module#

Use img_resample (resample) from UNRAVEL to resample a 3D image and save it.

Note

  • target_res, xy_res, and z_res should have the same units (e.g., microns).

  • If saving as .nii.gz without a reference, orientation defaults to RAS. Use io_reorient_nii to set orientation.

Supports:
  • Input formats: .nii.gz, .tif, .zarr, .h5, .czi

  • Output formats: .nii.gz, .tif, .zarr, .h5

Usage:#

img_resample -i image.nii.gz [-tr target_res | -td target_dims | -sc scale_factor | -r reference_image] [-s save_as] [-zo zoom_order] [-o output_dir] [-c czi_channel] [-x xy_res] [-z z_res] [-d dtype] [-v]

Usage for isotropic resampling:#

img_resample -i image.nii.gz -tr 50

Usage for anisotropic resampling:#

img_resample -i image.nii.gz -tr 200 10 10

Usage for resampling by scale factor:#

img_resample -i image.nii.gz -sc 0.5

Usage to resample using a reference image:#

img_resample -i image.nii.gz -r ref.nii.gz

unravel.image_tools.resample.parse_args()[source]#
unravel.image_tools.resample.main()[source]#