From axelt at drcmr.dk Tue Mar 1 20:36:08 2022 From: axelt at drcmr.dk (Axel Thielscher) Date: Tue, 1 Mar 2022 20:36:08 +0100 Subject: [Simnibs-discuss] Expanded details on coil-to-cortex distance measurement In-Reply-To: References: Message-ID: <01e27630-085e-4ff8-0249-e7d84e4b3ffe@drcmr.dk> Hi, this function calculates the shortest distance between the coil center and the nearest point on the cortex surface: https://github.com/simnibs/simnibs/blob/master/simnibs/simulation/sim_struct.py, lines 1350-1354. Best, Axel On 2/15/2022 5:20 PM, Mccalley, Daniel wrote: > Hi all, > > Could you please provide an expanded explanation of how the > coil-to-cortex distance provided in the output log file is measured? > I'm guessing that this is done using a custom matlab function or > another existing function? > > In either case it would be very helpful to have a rough outline of the > function used and how this distance is measured! Thank you in advance! > > Best, > > Dan McCalley > Medical University of South Carolina > College of Graduate Studies, Neuroscience > (he/him) > > > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss -- 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: From themidgeo at gmail.com Fri Mar 4 23:02:37 2022 From: themidgeo at gmail.com (D Ward) Date: Fri, 4 Mar 2022 22:02:37 +0000 Subject: [Simnibs-discuss] Clinical Application of SimNIBS Message-ID: Good evening, I hope you are well. I'm an undergraduate student currently using SimNIBS on my research project. I'm having no problems with the software, in fact I've found all of the documentation and tutorials on the website really insightful and have been able to troubleshoot any errors that come up relatively easily. I just wanted to ask a question - you state on your website that SimNIBS is only for research rather than clinical use. I'm just wondering why it's exclusively used for research, and what changes would need to be made in order for it to have clinical applications? Many thanks, DD -------------- next part -------------- An HTML attachment was scrubbed... URL: From axelt at drcmr.dk Tue Mar 8 11:46:21 2022 From: axelt at drcmr.dk (Axel Thielscher) Date: Tue, 8 Mar 2022 11:46:21 +0100 Subject: [Simnibs-discuss] Clinical Application of SimNIBS In-Reply-To: References: Message-ID: <42ecd751-aa5b-638d-2af7-8d49c467f7c3@drcmr.dk> Hi, SimNIBS did not undergo an approval process (FDA or CE) for software for clinical applications. This is a very costly and time intensive step. This is why we have the disclaimer on the homepage. We still aim to provide high quality software and documentation. Best regards, Axel On 3/4/2022 11:02 PM, D Ward wrote: > Good evening, > > I hope you are well. > > I'm an undergraduate student currently using SimNIBS on my research > project. I'm having no problems with the software, in fact I've found > all of the documentation and tutorials on the website really > insightful and have been able to troubleshoot any errors that come up > relatively easily. > > I just wanted to ask a question - you state on your website that > SimNIBS is only for research rather than clinical use. I'm just > wondering why it's exclusively used for research, and what changes > would need to be made in order for it to have clinical applications? > > Many thanks, > DD > > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss -- 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: From utkarshpancholi6387 at gmail.com Tue Mar 15 11:17:08 2022 From: utkarshpancholi6387 at gmail.com (utkarsh) Date: Tue, 15 Mar 2022 15:47:08 +0530 Subject: [Simnibs-discuss] Change electric field upon change in conductivity Message-ID: <1FEFFE07-6C17-4870-A81A-7AC85BCA3580@hxcore.ol> An HTML attachment was scrubbed... URL: From jgchoi at keri.re.kr Fri Mar 18 08:31:31 2022 From: jgchoi at keri.re.kr (=?ks_c_5601-1987?B?w9bA57G4?=) Date: Fri, 18 Mar 2022 16:31:31 +0900 Subject: [Simnibs-discuss] Missing matlab function error in tDCS Optimization Message-ID: <000001d83a9a$306db3a0$91491ae0$@keri.re.kr> Hi, I am just a beginner for Simnibs. I met a missing matlab function(sim_struct) error in tDCS Optimization, in Windows. Any help would be appreciated. Thanks a lot. Jaegu Choi -------------- next part -------------- An HTML attachment was scrubbed... URL: From axelt at drcmr.dk Fri Mar 18 19:30:12 2022 From: axelt at drcmr.dk (Axel Thielscher) Date: Fri, 18 Mar 2022 19:30:12 +0100 Subject: [Simnibs-discuss] Missing matlab function error in tDCS Optimization In-Reply-To: <000001d83a9a$306db3a0$91491ae0$@keri.re.kr> References: <000001d83a9a$306db3a0$91491ae0$@keri.re.kr> Message-ID: Hi, does matlab find other SimNIBS matlab functions, such as mesh_load_gmsh4? Otherwise, please ensure that you add the simnibs matlab directory to the matlab search paths. Best, Axel On 3/18/2022 8:31 AM, ??? wrote: > > Hi, > > I am just a beginner for Simnibs. > > I met a missing matlab function(sim_struct) error in tDCS > Optimization, in Windows. > > Any help would be appreciated. > > Thanks a lot. > > ** > > *Jaegu Choi* > > > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss -- 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: From sebastien.proulx2 at mail.mcgill.ca Mon Mar 21 03:16:21 2022 From: sebastien.proulx2 at mail.mcgill.ca (Sebastien Proulx) Date: Mon, 21 Mar 2022 02:16:21 +0000 Subject: [Simnibs-discuss] how to use freesurfer analysis that we already performed (outside mri2mesh) Message-ID: Hello, I have some freesurfer that I already run separately, and edited carefully. Now I would like to use them in SimNIBS, but I am having a hard time figuring out how to have mri2mesh accept a fs directory that was not run from mri2mesh. Any tip, instructions? Thanks and Have a very good day! S?bastien -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.proulx2 at mail.mcgill.ca Mon Mar 21 15:45:07 2022 From: sebastien.proulx2 at mail.mcgill.ca (Sebastien Proulx) Date: Mon, 21 Mar 2022 14:45:07 +0000 Subject: [Simnibs-discuss] subscribe not working Message-ID: FYI, on SimNIBS' contact page, the link to subscribe to the email list does not work on my side "Service Unavailable". -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stein at uq.edu.au Wed Mar 23 07:51:18 2022 From: a.stein at uq.edu.au (Athena Stein) Date: Wed, 23 Mar 2022 06:51:18 +0000 Subject: [Simnibs-discuss] using simNIBS in brain injury populations Message-ID: Hi, I was wondering how accurate simNIBS is when used in a brain with injury (especially diffuse axonal injury, gliosis etc.). e.g. is simNIBS able to do any kind of voxel-wise analysis which might capture these diffuse injuries? I am hoping to use simNIBS to look into reverse calculation of tDCS needed in an attempt to standardise current dose at the cortex. Thank you for all of your work - I am a big simNIBS fan! Thanks Athena Athena Stein FHEA MPH BBiomedSc PhD Candidate Casual Academic UQ Child Health Research Centre Acquired Brain Injury in Children research program (ABiC) Centre for Children's Health Research Level 6, 62 Graham St South Brisbane Qld 4101 Australia T +61 7 3069 7555 E a.stein at uq.edu.au W child-health-research.centre.uq.edu.au CRICOS 00025B [cid:image001.png at 01D83ED6.3738EA70] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 93663 bytes Desc: image001.png URL: From 13107971051 at 163.com Fri Mar 25 10:43:26 2022 From: 13107971051 at 163.com (Yunqing Chen) Date: Fri, 25 Mar 2022 17:43:26 +0800 (CST) Subject: [Simnibs-discuss] why generate the head model slowly? Message-ID: <7afd8156.4768.17fc075993d.Coremail.13107971051@163.com> Hi, I am a beginner for Simnibis. when I follow the steps of tutorial to generate a head model by headreco, I find it takes a long time to generate the head model. until I send this email, I spend 4 hours waiting for the result of headreco. I use the example dataset. I want to ask that does this procedure really takes a long time? or it is my wrong operation that causes this problem. if it isn't my fault, do you have some method to accelerate this step? likely, use GPU. My English is poor. Sorry if my English trouble you. Thanks a lot! -------------- next part -------------- An HTML attachment was scrubbed... URL: From quentin.mesnildrey at corstim.com Fri Mar 25 16:54:54 2022 From: quentin.mesnildrey at corstim.com (Quentin Mesnildrey) Date: Fri, 25 Mar 2022 16:54:54 +0100 Subject: [Simnibs-discuss] First steps into Simnibs Message-ID: <05ca5ac4-f93f-f02f-2185-06797eee8154@corstim.com> 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 From autofixegypt at gmail.com Fri Mar 25 20:26:31 2022 From: autofixegypt at gmail.com (mostafa abd elsamea) Date: Fri, 25 Mar 2022 21:26:31 +0200 Subject: [Simnibs-discuss] designing tms coil Message-ID: hello , im trying to design a tms not in simnibs library, what is the tool should i use the second question is what is column name in the tms ccd file comes with simnibs thanks alot have a good day -------------- next part -------------- An HTML attachment was scrubbed... URL: From Goikhia.Eng at nyulangone.org Mon Mar 28 10:57:59 2022 From: Goikhia.Eng at nyulangone.org (Eng, Goi Khia) Date: Mon, 28 Mar 2022 08:57:59 +0000 Subject: [Simnibs-discuss] Define coil orientation in Localite Message-ID: Hello, I am trying to optimize coil positioning and orientation for TMS but I am not sure how to apply the affine transformation matrix in Localite (matrix shown below). I used headreco to generate the headmodel. - Because I used headreco, the values in the matrix are in native space, is that correct? - How do I define the entry target in Localite? Would this be 84.3, -8.4, 35.6? - How do I calculate the rotation angle from this matrix? I am aware of the coil and axes orientations in SimNIBS and Localite (attached) but do not know how to use that information to set the rotation angle. Affine matrix after TMSoptimize: [[-5.7218e-03 -3.2704e-01 -9.4499e-01 8.4300e+01] [-8.5258e-01 -4.9224e-01 1.7551e-01 -8.3755e+00] [-5.2256e-01 8.0669e-01 -2.7601e-01 3.5573e+01] [ 0.0000e+00 0.0000e+00 0.0000e+00 1.0000e+00]] Thank you in advance, I appreciate all the help I can get. Goi Khia -- Goi Khia Eng Postdoctoral Fellow, Department of Psychiatry New York University School of Medicine Visiting Scientist Nathan Kline Institute for Psychiatric Research goikhia.eng at nyulangone.org goikhia.eng at nki.rfmh.org ------------------------------------------------------------ This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email. ================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: coil_axesorientation.pdf Type: application/pdf Size: 1387783 bytes Desc: coil_axesorientation.pdf URL: From axelt at drcmr.dk Tue Mar 29 09:44:30 2022 From: axelt at drcmr.dk (Axel Thielscher) Date: Tue, 29 Mar 2022 09:44:30 +0200 Subject: [Simnibs-discuss] First steps into Simnibs In-Reply-To: <05ca5ac4-f93f-f02f-2185-06797eee8154@corstim.com> References: <05ca5ac4-f93f-f02f-2185-06797eee8154@corstim.com> Message-ID: <6631f2e5-2b2d-e4fa-e19d-24fb37c2ae3a@drcmr.dk> 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, > -- 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/ From axelt at drcmr.dk Tue Mar 29 15:02:54 2022 From: axelt at drcmr.dk (Axel Thielscher) Date: Tue, 29 Mar 2022 15:02:54 +0200 Subject: [Simnibs-discuss] using simNIBS in brain injury populations In-Reply-To: References: Message-ID: <14245d04-dcf3-46b1-f954-929806a74496@drcmr.dk> Dear Athena, this is a good question which is not easy to answer. I would assume that the conductivity changes in gray and white matter correlate roughly with the diffusion changes seen in DTI. So a first step could be to simply quantify the diffusion changes compared to healthy subjects to get an initial impression on whether adjustments of the conductivity values might be needed. You can map the results back to subject-specific nifti or to MNI (using eg. the options menu in the GUI) to read out voxel-specfic values. Best regards, Axel On 3/23/2022 7:51 AM, Athena Stein wrote: > > Hi, > > I was wondering how accurate simNIBS is when used in a brain with > injury (especially diffuse axonal injury, gliosis etc.). e.g. is > simNIBS able to do any kind of voxel-wise analysis which might capture > these diffuse injuries? > > I am hoping to use simNIBS to look into reverse calculation of tDCS > needed in an attempt to standardise current dose at the cortex. > > Thank you for all of your work ? I am a big simNIBS fan! > > Thanks > > Athena > > *Athena Stein* > > *FHEA MPH BBiomedSc* > > PhD Candidate > > Casual Academic > > UQ Child Health Research Centre > > Acquired Brain Injury in Children research program (ABiC) > > Centre for Children?s Health Research > > Level 6, 62 Graham St > > South Brisbane Qld 4101 Australia > > *T*?+61 7 3069 7555 > > *E*a.stein at uq.edu.au > *W*child-health-research.centre.uq.edu.au > > > CRICOS 00025B > > > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss -- 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 93663 bytes Desc: not available URL: From axelt at drcmr.dk Thu Mar 31 10:07:40 2022 From: axelt at drcmr.dk (Axel Thielscher) Date: Thu, 31 Mar 2022 10:07:40 +0200 Subject: [Simnibs-discuss] First steps into Simnibs In-Reply-To: <0919a799-bbe6-9b2d-8f2f-1456eda3bf5f@corstim.com> References: <05ca5ac4-f93f-f02f-2185-06797eee8154@corstim.com> <6631f2e5-2b2d-e4fa-e19d-24fb37c2ae3a@drcmr.dk> <0919a799-bbe6-9b2d-8f2f-1456eda3bf5f@corstim.com> Message-ID: 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: FMgOExUVWP0WWpHy.png Type: image/png Size: 19192 bytes Desc: not available URL: From quentin.mesnildrey at corstim.com Wed Mar 30 17:19:16 2022 From: quentin.mesnildrey at corstim.com (Quentin Mesnildrey) Date: Wed, 30 Mar 2022 17:19:16 +0200 Subject: [Simnibs-discuss] First steps into Simnibs In-Reply-To: <6631f2e5-2b2d-e4fa-e19d-24fb37c2ae3a@drcmr.dk> References: <05ca5ac4-f93f-f02f-2185-06797eee8154@corstim.com> <6631f2e5-2b2d-e4fa-e19d-24fb37c2ae3a@drcmr.dk> Message-ID: <0919a799-bbe6-9b2d-8f2f-1456eda3bf5f@corstim.com> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: FMgOExUVWP0WWpHy.png Type: image/png Size: 19192 bytes Desc: not available URL: -------------- next part -------------- Error using run_simnibs (line 30) There was an error running SimNIBS: Traceback (most recent call last): File "C:\Users\quent\SimNIBS-3.2\simnibs_env\lib\site-packages\simnibs\cli\run_simnibs.py", line 29, in main() File "C:\Users\quent\SimNIBS-3.2\simnibs_env\lib\site-packages\simnibs\cli\run_simnibs.py", line 25, in main run_simnibs(args.simnibs_file, args.cpus) File "C:\Users\quent\SimNIBS-3.2\simnibs_env\lib\site-packages\simnibs\simulation\run_simnibs.py", line 23, in run_simnibs p = read_mat(simnibs_struct) File "C:\Users\quent\SimNIBS-3.2\simnibs_env\lib\site-packages\simnibs\utils\matlab_read.py", line 80, in read_mat structure = SESSION(matlab_struct=mat) File "C:\Users\quent\SimNIBS-3.2\simnibs_env\lib\site-packages\simnibs\simulation\sim_struct.py", line 116, in __init__ self.read_mat_struct(matlab_struct) File "C:\Users\quent\SimNIBS-3.2\simnibs_env\lib\site-packages\simnibs\simulation\sim_struct.py", line 362, in read_mat_struct if PL['type'][0] == 'TMSLIST': IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indice -------------- next part -------------- clear p=genpath('C:\Users\quent\SimNIBS-3.2\'); addpath(p) % Initialize a session s = sim_struct('SESSION'); % Name of head mesh s.fnamehead = 'ernie.msh'; % Output folder s.pathfem = 'testsimu/'; S.map_to_surf = true; S.open_in_gmsh = true; num_elecs = 2; % Initialize a tDCS simulation s.poslist{num_elecs} = sim_struct('TDCSLIST'); % Set currents s.poslist{num_elecs}.currents = [1e-3 -1e-3]; %% STIM1 s.poslist{num_elecs}.electrode(1).channelnr = 1; % Electrode dimension s.poslist{num_elecs}.electrode(1).dimensions = [20 20]; % Rectangular shape s.poslist{num_elecs}.electrode(1).shape = 'ellipse'; % 5mm thickness s.poslist{num_elecs}.electrode(1).thickness = 5; % Electrode Position s.poslist{num_elecs}.electrode(1).centre = 'AFz'; % Electrode direction s.poslist{num_elecs}.electrode(1).pos_ydir = 'Cz'; %% STIM2 s.poslist{num_elecs}.electrode(2).channelnr = 2; % Electrode dimension s.poslist{num_elecs}.electrode(2).dimensions = [20 20]; % shape s.poslist{num_elecs}.electrode(2).shape = 'ellipse'; % 5mm thickness s.poslist{num_elecs}.electrode(2).thickness = 5; % Electrode Position s.poslist{num_elecs}.electrode(2).centre = 'POz'; % Electrode direction s.poslist{num_elecs}.electrode(2).pos_ydir = 'Cz'; %% run run_simnibs(s) From quentin.mesnildrey at corstim.com Thu Mar 31 10:15:31 2022 From: quentin.mesnildrey at corstim.com (Quentin Mesnildrey) Date: Thu, 31 Mar 2022 10:15:31 +0200 Subject: [Simnibs-discuss] First steps into Simnibs In-Reply-To: References: <05ca5ac4-f93f-f02f-2185-06797eee8154@corstim.com> <6631f2e5-2b2d-e4fa-e19d-24fb37c2ae3a@drcmr.dk> <0919a799-bbe6-9b2d-8f2f-1456eda3bf5f@corstim.com> Message-ID: Thanks I will try this right now. Sorry for this beginner's mistake. If I understood correctly, the variable num_elecs refers to the total number of stimulation modalities. ie: num_elecs? = 1 if tDCS only, (or TMS only) num_elecs? = 2 if TMS + tDCS (even if I use multiple tDCS electrodes) Is that right ? Thank you very much. Best Quentin Le 31/03/2022 ? 10:07, Axel Thielscher a ?crit?: > > 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/ -- Quentin Mesnildrey Chef de projet R&D? - CorStim quentin.mesnildrey at corstim.com +33688875685 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: FMgOExUVWP0WWpHy.png Type: image/png Size: 19192 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eHqS4mGVaaSeyjzK.png Type: image/png Size: 19192 bytes Desc: not available URL: