bids_atlas.utils.resample_atlas_target

bids_atlas.utils.resample_atlas_target(atlas, target)[source]

Check if the atlas is in the desired resolution and if not resample it.

Parameters:
  • atlas (string or NiftiImage) – Name of the atlas that should be evaluated concerning its resolution.

  • target (string, Path or NiftiImage) – Name of the template with the target resolution.

Returns:

atlas – The atlas, either in resampled or original form.

Return type:

NiftiImage

Examples

Check if the indicated atlas’ resolution fits with that of a target image. Here, the AAL atlas and 1mm resolution.

>>> resample_atlas_target('/home/user/AAL.nii',
                          '/home/user/tpl-MNI152NLin6Asym_res-01_desc-brain_T1w.nii.gz')