Issues getting hemi attribute from generated annotation Labels

I’m having some trouble with the read_labels_from_annot function output - I’m generating labels from the FSL average brain to use to constrain a source localization, but the output variable list doesn’t include the “hemi” attribute the Label object documentation specifies it should, even when I define the hemi string specifically as a function input. (So, then this is causing errors later when the apply_inverse function can’t identify which hemisphere the labeled vertices are from.) Anyone know if I’m missing something here, or accessing a parcellation that doesn’t play well with this function?

label_tag = 'G_and_S_cingul-Mid-Ant' # labels for aMCC both hemispheres
# get from left hemi specifically
label_lh = mne.read_labels_from_annot(subject='fsaverage', parc='aparc.a2009s', hemi='lh',
                                      regexp=label_tag,subjects_dir=path_to_mne_data_folder)
print(label_lh.hemi) # throws "'list' object has no attribute 'hemi'" error
  • MNE version: 1.2
  • operating system: macOS Catalina, Jupyter notebook running Python 3.7.10 kernel

Solved it, will leave up in case anyone finds helpful - items within a returned list of Labels need to be indexed in order to return the attributes:

print(label_lh[0].hemi)

The returned list itself will not have the attributes, which makes sense.

Which means apply_inverse will not work with only a list of Labels to constrain the source reconstruction. Assumedly one would need to morph multiple labels together to only feed in one label to do that all at once.