def _get_mri_header(fname):
 import nibabel as nib
 img = nib.load(fname)
 try:
  return img.header
 except AttributeError:
  return img.get_header()

def _get_mri_header ( fname ) : import nibabel as nib img = nib . load ( fname ) try : return img . header except AttributeError : return img . get_header ( )
get mri header using nibabel .