[Simnibs-discuss] First steps into Simnibs

Axel Thielscher axelt at drcmr.dk
Thu Mar 31 10:07:40 CEST 2022


Dear Quentin,

please change the line:

num_elecs = 2;

to

num_elecs = 1;

then it will work.


by num_elecs = 2, you specify that the tDCS simulation is added as 
simulation number 2 (i.e. s.poslist{2}) which SimNIBS should run:

% Initialize a tDCS simulation
s.poslist{num_elecs} = sim_struct('TDCSLIST');
% Set currents
s.poslist{num_elecs}.currents = [1e-3 -1e-3];

...

However, as there is no simulation number 1 (s.poslist{1} remains 
empty), SimNIBS complains. I guess you defined the TMS simulation as 
simulation number 1, so that it then worked.

Best,

Axel



On 3/30/2022 5:19 PM, Quentin Mesnildrey wrote:
> Dear all,
>
> please find the very basic simulation I tried to run and the 
> associated error message.
>
> Note that the same code works when I add a TMS section.
>
> Best
>
> Quentin
>
>
>
>
>
> Le 29/03/2022 à 09:44, Axel Thielscher a écrit :
>> Dear Quentin,
>>
>> can you please send the matlab script where the error occured?
>>
>> Best,
>>
>> Axel
>>
>>
>> On 3/25/2022 4:54 PM, Quentin Mesnildrey wrote:
>>> Dear community,
>>>
>>> I am just beginning to run simulations using simnibs so I apologize 
>>> in advance if my question has been answered in the past. If so, 
>>> please redirect me to a previous discussion.
>>>
>>> I have managed to run tDCS simulation using the GUI. My next step is 
>>> to run it using matlab scripts. I started using the tutorial script 
>>> provided on the website. Everything seems to work well when I do not 
>>> change anything but when I remove the TMS component (which I am not 
>>> interested in), I end up with the following error message :
>>>
>>> **************
>>> if PL['type'][0] == 'TMSLIST':
>>> IndexError: only integers, slices (`:`), ellipsis (`...`), 
>>> numpy.newaxis (`None`) and integer or boolean arrays are
>>> valid indices
>>> **************
>>> Which seems to indicate that not having the TMS is problematic.
>>>
>>> I would deeply appriciate any advice on this (beginner) issue.
>>>
>>> Best regards,
>>>
>
> -- 
> Quentin Mesnildrey
> Chef de projet R&D  - CorStim
> quentin.mesnildrey at corstim.com
> +33688875685

-- 
Dr. Axel Thielscher
Professor of Neurophysics and Neuroimaging
Danish Research Center for Magnetic Resonance
Copenhagen University Hospital Hvidovre
DK-2650 Hvidovre, Denmark
www.drcmr.dk
&
Department of Health Technology
Technical University of Denmark
DK-2800 Kgs. Lyngby
http://www.healthtech.dtu.dk/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.drcmr.dk/pipermail/simnibs-discuss/attachments/20220331/5f670f19/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FMgOExUVWP0WWpHy.png
Type: image/png
Size: 19192 bytes
Desc: not available
URL: <https://mailman.drcmr.dk/pipermail/simnibs-discuss/attachments/20220331/5f670f19/attachment-0001.png>


More information about the Simnibs-discuss mailing list