neuromaps.images.relabel_gifti
- neuromaps.images.relabel_gifti(parcellation, background=None, offset=None)[source]
Update GIFTI images so label IDs are consecutive across hemispheres.
- Parameters:
parcellation ((2,) tuple-of-str) – Surface label files in GIFTI format (lh.label.gii, rh.label.gii)
background (list-of-str, optional) – If provided, a list of IDs in parcellation that should be set to 0 (the presumptive background value). Other IDs will be shifted so they are consecutive (i.e., 0–N). If not specified will use labels in neuromaps.images.PARCIGNORE. Default: None
offset (int, optional) – What the lowest value in parcellation[1] should be not including background value. If not specified it will be purely consecutive from parcellation[0]. Default: None
- Returns:
relabelled – Re-labelled parcellation files
- Return type:
(2,) tuple-of-nib.gifti.GiftiImage