# Question about computing band induced power for multiple labels

**URL:** https://mne.discourse.group/t/question-about-computing-band-induced-power-for-multiple-labels/9357
**Category:** Support & Discussions
**Tags:** meg
**Created:** [September 26, 2024, 9:48am UTC](https://mne.discourse.group/t/question-about-computing-band-induced-power-for-multiple-labels/9357 "2024-09-26T09:48:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![yaqing](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/yaqing/32/2503_2.png) [@yaqing](https://mne.discourse.group/u/yaqing)
#### Post date: [September 26, 2024, 9:48am UTC](https://mne.discourse.group/t/question-about-computing-band-induced-power-for-multiple-labels/9357/1 "2024-09-26T09:48:54Z")

</div>

Dear Forum,

I’m following [this tutorial](https://mne.tools/stable/auto_examples/time_frequency/source_space_time_frequency.html#sphx-glr-auto-examples-time-frequency-source-space-time-frequency-py) to compute induced power time course in different frequency bands. I wanted to compute separately for a number of ROIs that I created based on FreeSurfer parcellation (I have verified them in other analyses). As the API indicates, if I pass the label parameter of the following function as a list of multiple labels, I should get the estimated power for all labels (i.e. my ROIs):

> stcs = source\_band\_induced\_power(  
> epochs, inverse\_operator1, bands, label=label, n\_cycles=2, n\_jobs=-1  
> )

However, this gives me the following error:

> ValueError: Vertices must be ordered in increasing order.

What does this error mean?  
For the moment I work around the problem by looping over every label and computing the average of all vertices in the label as, for example:

> stcs[“theta”].data.mean(axis=0)

However, I’m afraid this is not the most efficient way and would like to understand what the error message means.

**A more important question** is that I noticed the tutorial code directly used epoch data, i.e. without subtracting evoked response, when calculating the induced power. Is this ideal? Does the function subtract the evoked response automatically (I couldn’t identify from the source code)? And as I understand from an [earlier discussion](https://mne.discourse.group/t/question-about-baseline-in-time-frequency-representation/8033/2), it is preferred to apply again baseline correction when computing the TFR from already baseline-corrected evoked response. Is this still true for calculating induced power?

Thank you in advance for your input.

Yaqing

---

<div class="post-metadata">

### Author: ![lbailey25](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/lbailey25/32/4276_2.png) [@lbailey25](https://mne.discourse.group/u/lbailey25)
#### Post date: [January 23, 2025, 5:36pm UTC](https://mne.discourse.group/t/question-about-computing-band-induced-power-for-multiple-labels/9357/2 "2025-01-23T17:36:56Z")

</div>

@yaqing I’m encountering the same problem. Did you find a solution?

---

<div class="post-metadata">

### Author: ![yaqing](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/yaqing/32/2503_2.png) [@yaqing](https://mne.discourse.group/u/yaqing)
#### Post date: [January 23, 2025, 7:38pm UTC](https://mne.discourse.group/t/question-about-computing-band-induced-power-for-multiple-labels/9357/3 "2025-01-23T19:38:43Z")

</div>

Yes, I basically just compute separately for each label (my ROIs). I didn’t average across labels, because I ended up running spatiotemporal permutation tests within each ROI.

---

<div class="post-metadata">

### Author: ![lbailey25](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/lbailey25/32/4276_2.png) [@lbailey25](https://mne.discourse.group/u/lbailey25)
#### Post date: [January 23, 2025, 7:46pm UTC](https://mne.discourse.group/t/question-about-computing-band-induced-power-for-multiple-labels/9357/4 "2025-01-23T19:46:16Z")

</div>

Ah, fair enough. Thanks!

In case this helps somebody in the future, another solution is to compute a single whole-brain stc, without supplying any labels, using:

> stc = source\_band\_induced\_power(epochs, bands, …)

and then iteratively extract the data from within each label, with something like:

> for label in labels:  
> stc\_in\_label = stc.in\_label(label)
