[Simnibs-discuss] Scripting simulation with Matlab - SimNIBS 4

Peyman Ghobadi peymanbiom at gmail.com
Sun Jan 22 13:08:01 CET 2023


Dear SimNIBS,

I recently used SimNIBS 4. I have a question about scripting simulation
with Matlab. The GUI is working fine in SimNIBS 4. But when I run my script
in Matlab I get the following error:



























*%% General informationS = sim_struct('SESSION');S.subpath = 'm2m_sub01'; %
subject folderS.pathfem = 'tdcs_simu'; % Folder for the simulation
outputS.map_to_surf = true;   %% Define tDCS simulationS.poslist{1} =
sim_struct('TDCSLIST');S.poslist{1}.currents = [0.002, -0.002]; % Current
flow though each channel (A)%First
ElectrodeS.poslist{1}.electrode(1).channelnr = 1; % Connect the electrode
to the first channelS.poslist{1}.electrode(1).centre = 'F4'; % Place it
over F4S.poslist{1}.electrode(1).shape = 'rect'; %Rectangular
electrodeS.poslist{1}.electrode(1).dimensions = [50, 70]; % Dimension in
mmS.poslist{1}.electrode(1).thickness = 4; % 4 mm thickness%Second
ElectrodeS.poslist{1}.electrode(2).channelnr =
2;S.poslist{1}.electrode(2).centre = 'F3';S.poslist{1}.electrode(2).shape =
'rect';S.poslist{1}.electrode(2).dimensions = [50,
70];S.poslist{1}.electrode(2).thickness = 4;%% Run
Simulationrun_simnibs(S);*


Error using run_simnibs (line 30)
There was an error running SimNIBS:
 Traceback (most recent call last):
  File
"/home/incas/SimNIBS-4.0/simnibs_env/lib/python3.9/site-packages/simnibs/cli/run_simnibs.py",
line 7, in <module>
    from simnibs import run_simnibs
  File
"/home/incas/SimNIBS-4.0/simnibs_env/lib/python3.9/site-packages/simnibs/__init__.py",
line 21, in <module>
    from .mesh_tools import *
  File
"/home/incas/SimNIBS-4.0/simnibs_env/lib/python3.9/site-packages/simnibs/mesh_tools/__init__.py",
line 6, in <module>
    from .mesh_io import *
  File
"/home/incas/SimNIBS-4.0/simnibs_env/lib/python3.9/site-packages/simnibs/mesh_tools/mesh_io.py",
line 49, in <module>
    from . import cgal
  File
"/home/incas/SimNIBS-4.0/simnibs_env/lib/python3.9/site-packages/simnibs/mesh_tools/cgal/__init__.py",
line 1, in <module>
    from .create_mesh_surf import *
ImportError:
/home/incas/SimNIBS-4.0/simnibs_env/lib/python3.9/site-packages/simnibs/mesh_tools/cgal/
create_mesh_surf.cpython-39-x86_64-linux-gnu.so: undefined
symbol: __gmpq_add


Error in tDCS (line 27)
run_simnibs(S);


I look forward to hearing from you.

Best regards,
Peyman
-- 
Peyman Ghobadi-Azbari
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.drcmr.dk/pipermail/simnibs-discuss/attachments/20230122/ac24799a/attachment.html>


More information about the Simnibs-discuss mailing list