PS, I am not able to use the above code because it seems that they used the channel format of eeglab, where in BST we do not have "theta", and the other variable exist in the image below,
either if you can help me convert the channel of bst to the below format or how can I project one dipole to channel in BST or if yiu can help me with both it would be great
You can export to a different file by right-clicking the channel file and then exporting to file and then you can save it into EEG Lab format. For your first question, you can do that by scripting in brainstorm, you can get the lead field matrix in Matlab and do arithmetic on that
You could convert with matlab x,y,z to theta rho phi by using a cartesian to spherical transformation. Brainstorm doesn't have this implemented for exporting as far as i know
What you can do is export the leadfield matrix to matlab and then multiplying it by your sources, thus one dipole, arbitrary orientation, and import it as EEG data back into brainstorm and do the visualisations.
You can create a scout, define some activity for it (=simulate a signal), and use both to simulate recordings. This would use the orientation defined in your source model (= the normal to the cortex):
From the forward model (matrix Gain), if you know how to obtain a matrix [Nchannels x 1], you can use the function view_topography() to display it, by setting it as the input variable "F" (read the help at the beginning of the function): [hFig, iDS, iFig] = view_topography(DataFile, Modality, TopoType, F)
changing the orientation of that dipole and again project it to the electrodes
This is not that easy to do, it would involve some scripting and deep understanding of the Brainstorm data structures involves.
A research group in Oldenburg has recently done a simulation study with Brainstorm, they were observing the effect of dipoles orientation and depth on the scalp EEG. The article will be published soon, and maybe they have some example scripts they could already share. @ArndMeiser@martinbleichner@stedeben
where in BST we do not have "theta"
As mentioned by @SBeumer, you can use [theta,phi,r] = cart2sph(x,y,z).
OK thank you, can we choose 1 dipole and project it to the electrode?
Thank you Francois, @ArndMeiser@martinbleichner@stedeben do you have some example scripts for studying the effect of dipoles orientation and depth on the electrode?