Dear Brainstorm community,
As the title suggests, I'm trying to perform a cluster/permutation test using paired t-tests for 2 within subject conditions (27 subjects in total).
After computing the power and averaging the files across trials, I have successfully loaded one file per subject/condition in the Process2 tabs in the bottom of Brainstorm:

However, when I select Run > Test > Permutation test: Paired, I get the following error:

And indeed, if I put a debug at line 184 of process_test_permutation2.m, sDataA has no field Measure:
K>> sDataA
sDataA =
Value: [4-D double]
Std: []
Comment: ''
Description: {256x1 cell}
Time: [100 119.9960]
ChannelFlag: []
nAvg: 1
Events: []
SurfaceFile: []
Atlas: []
DisplayUnits: []
History: {28x3 cell}
Interestingly, when I try simply Run > Test > Parametric Test: Paired, it works fine.
I'm using Brainstorm version 3.4 (21-Nov-2016)
Any ideas why this could be happening?
Thank you in advance for any help!
Leonardo Barbosa
Hi Leonardo,
I added a test so that it does crash at the line you pointed.
However, this is not going to solve your problem. There is something weird about your data.
In your screen captures of the Process2 tab, the type of data selected is “time-frequency”.
But what the sData variable you reported is a structure corresponding to a “matrix” file (ie. extracted scouts time series).
I could not reproduce a case where this would happen.
Have you created these files yourself? If so, you may have done some mistake in the file structures or naming.
Can you post a screen captures showing what is inside one of the files you are testing (right-click > File > View file contents) and the window with all the options of the permutation test process.
Thanks
Francois
Hi Francois,
Thank you for your reply.
[QUOTE=Francois;11349]
There is something weird about your data.
In your screen captures of the Process2 tab, the type of data selected is "time-frequency".
But what the sData variable you reported is a structure corresponding to a "matrix" file (ie. extracted scouts time series).
I could not reproduce a case where this would happen.
Have you created these files yourself? If so, you may have done some mistake in the file structures or naming.
Francois[/QUOTE]
I did not create the files myself, other than importing a fif with a raw file and epoching based in a STIM channel.
After that, All I did was inside brainstorm. It is really weird that it resembles a scout since I definitely did not do that.
Here is the history of one of the files that I'm trying to run the cluster/permutation analyses:
- 02-Dec-2016 15:28:55 | average | Average: By folder (subject average)
- 02-Dec-2016 15:28:55 | average | History of the first file:
- 02-Dec-2016 15:26:26 | compute | - Time-frequency decomposition
- 02-Dec-2016 15:28:34 | process | - process_tf_measure: Measure from complex values: Magnitude
- 02-Dec-2016 15:28:39 | process | - process_average_time: Average time: [all]
- 02-Dec-2016 15:28:45 | avgfreq | - Averaged all the frequency bands.
- 02-Dec-2016 15:28:55 | average | List of averaged files:
- 02-Dec-2016 15:28:55 | average | - 2004_T2/1/timefreq_trial001_psd_161202_1526_meas_avg.mat
- 02-Dec-2016 15:28:55 | average | - 2004_T2/1/timefreq_trial002_psd_161202_1526_meas_avg.mat
- 02-Dec-2016 15:28:55 | average | - 2004_T2/1/timefreq_trial003_psd_161202_1526_meas_avg.mat
[QUOTE=Francois;11349]
Can you post a screen captures showing what is inside one of the files you are testing (right-click > File > View file contents) and the window with all the options of the permutation test process.
Francois[/QUOTE]
Here they are:
I also tried without checking the "average" options, but got the same error.
I managed to rung the filedtrip cluster/permutation, here is the options I used:
Thank you,
Leonardo
Hi Leonardo,
For the history of the files, I understand that you executed the following processes on the epochs you imported:
- Frequency > Power spectrum density (averaged by frequency bands)
- Extract > Measure from complex value => Do you have reason for testing the magnitude instead of the power?
- Average > Average time => This has no effect, there is no time dimension in these PSD files
- Average > Average frequency bands => OK
- Average the epochs for each subjects (27 subjects) and each condition (“1” and “2”) => OK
In the options of the permutation tests: it does not change anything if you are selecting any of the averaging options, the files you test have no time dimension and the frequencies are already averaged.
I modified a bit the code of the function that extract the values so that it does not convert automatically the PSD files in flat “matrix files”.
Now the output of the test should be a “stat/PSD” file, for which you can display a topography.
Please update Brainstorm and try again (menu Help > Update Brainstorm).
Cheers,
Francois
Hi all
I've tried to compute permutation test for my two PSD.
I got no result from this part. I aslo changed the Pvalue.
would you please tell me what is my wrong?
2- when I close the brainstorm and run again I can't do t test and I have an error which is about same size problem. my signals can't be the same size.
Hamed
Hi Hamed,
Population statistical tests such as permutation tests require multiple samples per population. Refer to the Statistics tutorial page for more information: http://neuroimage.usc.edu/brainstorm/Tutorials/Statistics
Cheers,
Martin
Hi Martin
Thanks for your answer.
I’ve read this tutorial but one part is not clear to me.
How should I select Time window? In tutorial time window selected based on highest value for sensor MLP57 at 160ms, that’s why the time window selected 160.
For my analysis, I would like to analyze all sensors over the entire recordings but I have same size error problem.
Would you please let me know what is the exact method for selecting Time window?
Best Regards,
Hamed
Dear Hamed,
This forum is meant to help people use the Brainstorm software. Your questions are more methodological than technical, I’d recommend you start by some additional background reading in electrophysiology and EEG analysis, then do a literature review in your field. When you know exactly what kind of analysis you’d like to run on your data, please get back to us with precise requests and we will help you translate this into Brainstorm operations.
Cheers,
Francois