Hi
I ran perm t tests on my source data. I would like to open the resulting file in MatLab so I can automatically export these images. I've tried various approaches to do this based on the scripting tutorial but I can't find the 'view_**(sFiles(i).FileName)' handle for this. The file type is 'presults' Could you tell me how I can open it?
I also tried
sStudy = bst_get('Study', sFiles(3).iStudy);
sSubject = bst_get('Subject', sStudy.BrainStormSubject);
FileSource = sSubject.Anatomy(sSubject.iAnatomy).FileName;
hFig = view_surface(FileSource);
I also tried
sCortex = in_tess_bst(sFiles(1).FileName)
hFig = view_surface(sCortex);
You can display the stat source files presults with the following functions:
view_surface_data([], ResultsFile);
To set the options of the stat tab:
% Set display properties
StatThreshOptions = bst_get('StatThreshOptions');
StatThreshOptions.pThreshold = 0.05;
StatThreshOptions.Correction = 'fdr';
StatThreshOptions.Control = [1 2 3];
bst_set('StatThreshOptions', StatThreshOptions);
For other configuration options of the 3D figure, see the examples in the script tutorial_introduction.m.
You can also use the process Snapshot:
https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting#Starting_a_new_script
Hi
I tried to alter the StatThreshold. Not sure what happened, but now I can't open any source stats file. The other source files (Average, Difference) open no problem but all source stat files have same error. I ran the script on a dummy folder only with copied source stats files. I get the below error message. I copy the struct of one of these files below that.
Also how do I delete the legend of the color bar? I am trying to find the handle for this object.
StatThreshOptions = bst_get('StatThreshOptions');
StatThreshOptions.pThreshold = 0.05;
bst_set('StatThreshOptions', StatThreshOptions);
** Error: Line 39: Unable to perform assignment because dot indexing is not supported for variables of this type.
**
** Call stack:
** >struct_copy_fields.m at 39
** >bst_get.m>FillMissingFields at 4098
** >bst_get.m at 3047
** >panel_stat.m>UpdatePanel at 266
** >panel_stat.m>CreatePanel at 139
** >panel_stat.m at 27
** >gui_show.m at 79
** >gui_brainstorm.m>ShowToolTab at 1180
** >gui_brainstorm.m at 33
** >bst_memory.m>LoadResultsFile at 1157
** >bst_memory.m at 72
** >view_surface_data.m at 153
** >tree_callbacks.m at 298
** >bst_call.m at 28
** >panel_protocols.m>CreatePanel/protocolTreeClicked_Callback at 125
** >bst_call.m at 28
** >panel_protocols.m>@(h,ev)bst_call(@protocolTreeClicked_Callback,h,ev) at 75
Struct
Atlas: []
ChannelFlag: []
ColormapType: 'stat2'
Comment: 'Perm t-test unequal [80ms,110ms]: Avg: 11_right | bl | _HLG_MLD (21) vs. Avg: 11_right | bl | _CG (14)'
Correction: 'no'
DataType: 'recordings'
Description: []
DisplayUnits: 't'
Freqs: []
GoodChannel: []
GridAtlas: []
GridLoc: []
GridOrient: []
HeadModelType: 'surface'
History: {39×3 cell}
Measure: []
Method: []
Options: [1×1 struct]
RefRowNames: []
RowNames: []
SPM: []
StatClusters: []
SurfaceFile: '@default_subject/tess_cortex_pial_low.mat'
TFmask: []
Time: [0.0781 0.1094]
TimeBands: []
Type: 'results'
df: []
nComponents: 1
pmap: [15002×2 double]
tmap: [15002×2 double]
Device: []
Events: []
F: []
Leff: 1
Std: []
nAvg: 1
You accidentally set StatThreshOptions to something that was not a struct.
The call bst_set('StatThreshOptions', StatThreshOptions) does not test for the validity of the inputs, saved the wrong variable type, and then even bst_get stops working.
I made the code more robust: Making FillMissingFields robust to non-struct fields · brainstorm-tools/brainstorm3@d015c2b · GitHub
Update Brainstorm again to get this fix.
If this doesn't solve your problem, you can reset this variable with the code:
global GlobalData;
GlobalData.Preferences.StatThreshOptions = [];
With your future attempts, make sure StatThreshOptions remains a struct with strictly the fields originally available:
StatThreshOptions =
struct with fields:
pThreshold: 0.0500
durThreshold: 0
Correction: 'fdr'
Control: [1 2 3]
That worked, thanks Francois.
Could you tell me how do I delete the legend of the color bar so only the brain appears in the image for publication? I am trying to find the handle in MatLab for this object. I'll set all images to the same range using;
bst_colormaps('SetMaxCustom', 'stat2', hFigTf1, -5, 5);
Then place a single color bar for the multiple images.
Hi @DavidLoughrey,
You can hide the colorbar from a Brainstorm Figure with:
bst_colormaps('SetColorbarVisible', hFig, 0);
Hi
Is it possible to change the color of significantly activated vertices for these files? Right now positive/red regions indicate higher activity levels for the first group in the perm t results, and negative/blue regions higher activity for the second group. Can I change the color for one group to a select color such as green? I have multiple perm tests comparing results across three groups so would like colors to remain consistent for each group across images.
You can change the colormap used for each type of data, and even design your own colormaps.
https://neuroimage.usc.edu/brainstorm/Tutorials/Colormaps
Is this what you were looking for?