label.center_of_mass function?

Hi,

Is there still the function label.center_of_mass which computes the spatial
center of mass of a label?

Thanks and Best Regards,
Gladia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20170811/8a2823b6/attachment.html

Yes indeed:

https://mne-tools.github.io/dev/generated/mne.Label.html#mne.Label.center_of_mass

Eric

Hi Eric,

When I try to do label.center_of_mass I get the error "AttributeError:
'Label' object has no attribute 'center_of_mass'". However,
SourceEstimate.center_of_mass does work. Do I need to do something to the
label to access the function?

Thanks and Best,
Gladia

Are you on an old version of MNE (mne.__version__)? I get this on latest
`master` and the 0.14.1 branch:

label = mne.read_label(mne.datasets.sample.data_path() + '/subjects/sample/label/lh.BA45.label')
label.center_of_mass('sample', subjects_dir=mne.datasets.sample.data_path() + '/subjects')

136871

?
Eric

Hi Eric,

That must be it- my version is 0.11.0. I'll try to update and try again.
Thanks!

Best,
Gladia

Hi Eric,

I'm trying to update MNE on a Martinos Center computer but
pip install mne --upgrade
returns a 'Permission denied' error. How can I get the latest version at
the Martinos Center?

Thanks and Best,
Gladia

I'm not sure what the standard procedures are at MGH, but you can do `pip
install --user` to install a new version to your specific user's directory.

Eric

Hi Eric,

That seems to have worked. Thanks!

Best,
Gladia