Activate one dipole

Hello,

The step I did,

1)Run-->simulate-->simulate generic signals
2) rename the simulation by 'simu' and drag it to the process --> simulate recording from scouts
3) I have:
image

I dont no why there is two folder now 'simu' and 'dipoles: Meg..'
I exprted both of them
simu is
image

'dipoles: Meg..' is

image

what is the rule of 'dipoles: Meg..' ? do I want to use it for dipole orientation?

I make [ii,jj]=find(simu.ImageGridAmp>0); to find which index is just activated because I chose 1 scout,
then I get it, and this is fine because I want to be sure that just one dipole is activated

Now I want to make orientation this dipole several angle and each time I want to view its topoplot,
please can you help?

Thank you
Abdallah

The source file "simu" is the source file in which all the sources are set to zero except for the sources within the scout you selected in the process "Simulate recordings from scouts". This file was multiplied by the head model to create the recordings file "simu".

The other is a link, related to a "dipole modelling" shared kernel you computed in the same folder.
If you are not comfortable with these concepts, I'd recommend you start by following carefully ALL the tutorial datasets (section "Get started" on the tutorial page), at least until #23, and using the example MEG dataset provided. You'll need a very good understanding of the interface and data structures of the software before doing the simulations you're hoping to do...
https://neuroimage.usc.edu/brainstorm/Tutorials

Tutorial #22 explains the creation of these these links:
https://neuroimage.usc.edu/brainstorm/Tutorials/SourceEstimation#Computing_sources_for_single_trials

To simulate dipoles with different orientations, you'll need to use lower level functions than simply the GUI.

Have you discussed with the authors of this article yet?
https://link.springer.com/article/10.1007/s10548-020-00793-2

@ArndMeiser @martinbleichner FYI

Yes Thank you Francois, I discussed with @ArndMeiser, and I would like to take this opportunity to thank him very much for his kind help

I am trying to run the scripts first in my PC, so that I can understand them, and them apply some code to my application,
in step (a) of the scripts, I think it just required to have a cortex, but I donot know how to include it,

I created the anatomy manully for this subject
image

but I still have error

after putting the anatomy it compute the forward model but not the source model:

There are obviously some errors in your data structures. Maybe you are not familiar enough with how the Brainstorm database works. If you are familiar with Brainstorm (including scripting), reusing Arnd's scripts should be rather straightforward.
Following ALL the Brainstorm introduction tutorials with the example dataset provided would help you a lot... Without this prerequisite, we might not be able to help you much further with this forum.

@ArndMeiser @martinbleichner
It appears that this user did not manage to reuse the scripts provided on FigShare.
For training purposes and strict reproducibility of your findings, maybe it could be good to add a short document with guidelines on how to use these scripts, that beginners could follow step by step (Create a new protocols with these properties, Create a new subject, download this example dataset, link it to the database, etc).
What do you think?

Hello together,

sorry for taking so long to answer. I am currently preparing a new script. It will contain the most simple way to place and alter dipoles and to create sensitivity maps, without our specifications for different EEG-systems and complicated analysis steps. Hopefully, this will be of more use for everyone trying to use our pipeline. I will come back to you shortly.

Best,

Arnd

This sounds great!
Thanks

Thank you @ArndMeiser @Francois
The most important for me is to know how you generate dipole with different orientations and different depths
and then make a video, (in onther way if I place a sensors different from your sensor how can moved the dipole in defined rotation and defined depth)
thank you again for your help

Hello again,

on figshare, you will now find some additional scripts: Volume_dipole1-3 will allow you to place a dipole somewhere in the brain and to alter its orientation. The first script sets up the file structures. The second script will simply give you three dipoles at the same location with 3 different orientations. You can alter the values of location and orientation. The third script will allow you to display the dipoles with their corresponding scalp topographies, just as in the .avi files. The scripts Surface_sensitivity1-2 set up the file structures and create a sensitivity map from a standard 128 channel cap and display the result on the cortex, exactly like in the paper.
I hope this helps!

Best,

Arnd

Thank you very much Dr. Arnd and Dr Francois for this idea
every script works in my computer except the last one(surface sensitivity2) it gives the below error:

Surface_sensitivity2
Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in
the second matrix. To perform elementwise multiplication, use '.*'.

Error in Surface_sensitivity2 (line 47)
F(iChannels,:slight_smile: = HM.Gain(iChannels,:slight_smile: * IMAGEGRIDAMP; %for every channel, calc the forward model of the simulated source with
amp=1 (leadfield*activation)

I am also interesting for the moving of the dipole toward the depth, it seems not exist in this new scripts, can you please add it also?

Thank you again Arnd!

About the error I think because in the last script they consider the IMAGEGRIDAMP of the vomume source and not the surface one ,

I just changed manually the dimension of IMAGEGRIDAMP to 15002x1 then the scrpts run without error but I dont know where the results is saved, despite I put in the begining of the script:

PATHOUT = 'C:\Users\Desktop\alter_dipole\results'; %store the results here
but folder is empty

To address all the recent questions we had related with simulations, I added some code in Brainstorm and wrote a new tutorial:
https://neuroimage.usc.edu/brainstorm/Tutorials/Simulations

Maybe this could be a better starting point for you?