Error While Using An Atlas

Hi all experts of Brainstorm,

I am trying to downsample my source localization output to an atlas, but I ran into some errors.

  1. I loaded my atlas to the anatomy page and the mapping seems fine, but when I try to load this atlas from the subject anatomy, it failed:

  2. But I can re-load the atlas in a drop-down manu to the right hand side box. After reloading the atlas, I tried to run the "Down Sample to Atlas" function in the pipeline but I got an error output:

Line 161: Index in position 1 exceeds array bounds (must not exceed 1). _______________________________________________
Call stack: >process_source_atlas.m>Run at 161 >process_source_atlas.m at 24 >bst_process.m>Run at 197 >bst_process.m at 37 >panel_process1.m>RunProcess at 124 >panel_process1.m at 26 >gui_brainstorm.m>CreateWindow/ProcessRun_Callback at 768 >bst_call.m at 28 >gui_brainstorm.m>@(h,ev)bst_call(@ProcessRun_Callback) at 292 _______________________________________________

Does anyone know what these error messages mean and how I can fix them?

Any help is appreciated.

Many thanks!
Andy

Some additional information:

  1. The atlas in the anatomy folder:
  1. The atlas in after reloading in the drop-down manu:
  1. The error message:

My file structures:

I added an extra check for this error:

Please update Brainstorm and try again.

Note that importing surface scouts volume atlases is not recommended.
This menu Import from subject anatomy in the Scout tab is designed mostly for volume source models:
https://neuroimage.usc.edu/brainstorm/Tutorials/TutVolSource

After reloading the atlas, I tried to run the "Down Sample to Atlas" function in the pipeline but I got an error output:

Probably because you have some empty scouts in there...
We don't really recommend using this process "Downsample to atlas" anymore.
Instead: extract the scouts time series and then call the process " Full source maps from scouts":
https://neuroimage.usc.edu/brainstorm/Tutorials/Simulations#Generate_full_source_maps_from_scouts

The atlas in the anatomy folder:

It looks like there is a scaling issue here: your ROIs cover most of the skull and skin, and don't look at all aligned with the cortex.

The atlas in after reloading in the drop-down manu:

This looks pretty ugly in my opinion. Use surface-based atlases for surface-based source modeling.

My file structures:

I can see here that you are using a linear MNI normalization.
If you are using MNI-based parcellations, it is highly recommended to use a non-linear MNI registration. Use SPM Segment, or even better: run CAT12 on your MRI.

https://neuroimage.usc.edu/brainstorm/CoordinateSystems#MNI_coordinates
https://neuroimage.usc.edu/brainstorm/Tutorials/SegCAT12

Thank you very much for all the suggestions @Francois. I will try all these and get back to you.

Best,

@Francois Thank you for your suggestions. I am able to get the atlas mapped to the volume grid:

@Francois I was also able to get the reduced connectivity (coh) matrix for the source after applying PCA on each scout.

I have another question - is there a way to arrange the regions in the order I want in the connectivity matrix? I need to compare this connectivity matrix to the one I got from fMRI, in which the ROIs are arranged in a specific order.

Thanks,

I was also able to get the reduced connectivity (coh) matrix for the source after applying PCA on each scout.

This looks very noisy. You will need to run some group-level statistics to extract some meaningful information.

I have another question - is there a way to arrange the regions in the order I want in the connectivity matrix?

This is something you'll need to do manually with a Matlab script, by changing the order or the rows and columns in the following field of the connectivity file: RefRowNames, RowNames, TF.

@Francois Thank you for the resources.

I have another question. After I preprocess my data, I created overlapping spheres (volume) using regular grid:

Then I ran source localization and got the following outputs:
Screen Shot 2021-10-07 at 1.30.33 AM

Then I was trying to run the connectivity analysis to get the coherence matrix using the following settings:

It throws an error:

Do you know what it means? I am guessing that the source localization for a regular grid doesn't keep the time series data for the source space. Is there a way that I can work with the time series at the source space for a regular grid?

Best,

It throws an error

I could not reproduce this error. Please try with a smaller set of scouts, and try to understand what it the cause of the problem. Maybe some of the scouts are empty?
If you can't reproduce it, please try using the example dataset from the introduction tutorials, and describe how to reproduce the error from that example.

I am guessing that the source localization for a regular grid doesn't keep the time series data for the source space. Is there a way that I can work with the time series at the source space for a regular grid?

I'm not sure I understand this.
If you want to extract the scouts time series explicitly before running the connectivity analysis, use the process Extract > Scouts time series.

I was trying to run the connectivity analysis to get the coherence matrix using the following settings

I see that you are using a PCA approach. Make sure you update Brainstorm, as we fixed a major bug recently regarding the computation of the first PCA mode:

Thank you @Francois.

Is there a way to get the source space time series even before we group them into scouts?

The source time series are available directly from the database.

Is this what you are asking for?

Yes. Thank you @Francois.

Another question regarding the connectivity. I was trying to run some envelope correlation for the source signals, but the correlation matrix seems only showing positive correlations. I am wondering how the correlation is calculated? Should there be negative correlations as well?

@Francois. I think I figured out how to display negative correlations.

But another more important question - is there a way that I can run connectivity on timefreq data? I want to perform the following pipeline:
Source localization > hilbert-transform (envelop) on the source timeseries > downsample the envelop signals > run correlation on the downsampled signals > take the mean of the correlation for voxels in each scout.

However, I am stuck in the second step because I cannot run any source analysis on time-freq datatype which is the output of the hilbert-transform. Is there a way to do this operation?

No, but most connectivity metrics include some frequency or time-frequency analysis.
https://neuroimage.usc.edu/brainstorm/Tutorials/Connectivity2

However, I am stuck in the second step because I cannot run any source analysis on time-freq datatype which is the output of the hilbert-transform.

In the line above, you say "Source localization > hilbert-transform (envelop) on the source timeseries". This is correct way of proceeding, and does not require "any source analysis on time-freq datatype" (which is not possible).

If you really want to limit the source estimation to a specific frequency band, then filter all your recordings (including the noise recordings), and then estimate the sources.

For discussing new topics, please create new threads on the forum - this will make it easier to search the forum in the future. Btw, this topic of "source reconstruction of time-frequency decomposition" has been discussed a few times in the past, you can probably find these threads on the forum.

@Francois. Thank you.

Yes, next time I will open new threads for a new topic.

Actually, I think I made a mistake when when I was talking about the pipeline:

However, I am stuck in the second step because I cannot run any source analysis on time-freq datatype which is the output of the hilbert-transform.

I actually wanted to say:

However, I am stuck in the second step because I cannot run any connectivity analysis on time-freq datatype which is the output of the hilbert-transform.

And you already answered that there isn't any way to run connectivity on time-freq data. What I actually wanted to do is to down-sample the hilbert-transformed timeseires to remove autocorrelation, and then see if I can find any correlation structures for the whole brain activity. Potentially I would like to see if I can recover the default network structures that can be found in fMRI.

I think what I can only do is to Compute the hilbert-transform on source signals > Group them into scouts > Export them to matlab, and run my own analysis from there.

I think I got all my questions answered, thank you for all your suggestions. They are very helpful! And I really like Brainstorm. It is a great platform for MEG/EEG analysis particularly for interactive data analysis.