simple_align

nighres.registration.simple_align(source_image, target_image, copy_header=False, align_center=False, rescale=False, data_type='intensity', ignore_affine=False, ignore_header=False, save_data=False, overwrite=False, output_dir=None, file_name=None)[source]

Simple alignment routines

Simple routines to align image headers (image data is unchanged)

Parameters:
  • source_image (niimg) – Image to align
  • target_image (niimg) – Reference image to match
  • copy_header (bool) – To copy the target header to the source (default is False)
  • align_center (bool) – To align the source center of mass to the target (default is False)
  • rescale (bool) – To rescale the source to the volume of the target (default is False)
  • data_type ({'intensity','nonzero','boundingbox'}) – The type of datato consider for alignment (default is ‘intensity’)
  • ignore_affine (bool) – Ignore the affine matrix information extracted from the image header (default is False)
  • ignore_header (bool) – Ignore the orientation information and affine matrix information extracted from the image header (default is False)
  • save_data (bool) – Save output data to file (default is False)
  • overwrite (bool) – Overwrite existing results (default is False)
  • output_dir (str, optional) – Path to desired output directory, will be created if it doesn’t exist
  • file_name (str, optional) – Desired base name for output files with file extension (suffixes will be added)
Returns:

Dictionary collecting outputs under the following keys (suffix of output files in brackets)

  • result (niimg): Aligne source image (_al-img)

Return type:

dict

Notes

This uses the ANTs/ITK conventions with regard to Nifti headers, for better or for worse. Note that Nibabel conventions, of course, are different.