From jesperdn at drcmr.dk Tue Jan 3 09:43:43 2023 From: jesperdn at drcmr.dk (Jesper Duemose Nielsen) Date: Tue, 3 Jan 2023 09:43:43 +0100 Subject: [Simnibs-discuss] Issues with FreeView related to SimNIBS In-Reply-To: References: <524eba4208d64bfa82c028e89ef460fb@tum.de> <8f09d11a-5382-e69e-22f7-25cd18e26c80@drcmr.dk> Message-ID: <4e12a425-1610-565e-9cb5-3cd6f29f4f9b@drcmr.dk> Hi Daniela Yes, try to delete the msh file, rerun the meshing steps, and then the check again (you can add -f flag when running the check command to force remaking of the fsmesh files). Then let's see. Best, Jesper On 12/29/2022 18:19, Rodriguez Manrique, Daniela wrote: > > Dear Jesper, > > > thank you for your reply. We have tried deleting the two fsmesh files > (brain_contr.fsmesh and head_contr.fsmesh) before running headreco > surfacemesh, headreco volumemesh and headreco check. However, this led > to even more disappointing results of no changes in > SubID_final_contr.nii. > > > Do you suggest we also delete the .msh files? > > > Best Regards, > > Daniela Rodriguez > > > ------------------------------------------------------------------------ > *From:* Jesper Duemose Nielsen > *Sent:* 29 December 2022 08:48:16 > *To:* Rodriguez Manrique, Daniela; Oula; support at simnibs.org > *Subject:* Re: Issues with FreeView related to SimNIBS > > Hi Daniela > > > As I believe Axel (and perhaps also Oula) is on vacation at the > moment, let me try to send a few comments your way. > > > What is used in simulations is the .msh file (SubID.msh I suppose) of > which SubID_final_contr.nii is just a voxelized version I believe. The > fsmesh files are only used for visualization with FreeView. What might > be happening here is that headreco just uses the fsmesh files that are > already there (from checking your previous run). Perhaps try to delete > the fsmesh files and run headreco check again. (unless of course you > already did that in which case I am not sure what is causing this > behavior.) I don't have the code right now so I cannot really check. > > > Also, you could view the .msh file directly in gmsh. > > > Best, > > Jesper > > > On 12/28/2022 16:40, Rodriguez Manrique, Daniela wrote: >> >> Dear Oula and SimNIBS Support, >> >> >> I hope you had wholesome holidays. I regret to have to bother you >> with another SimNIBS question. >> >> >> When we have noticed issues with headreco segmentation in the >> different tissue masks, we've used free view to edit the respective >> binary mask located in /mask_prep e.g. MASK_CSF.nii.gz. Upon changing >> the mask we rerun "headreco surfacemesh SubID" and "headreco >> volumemesh SubID". Then look at "headreco check SubID" to check the >> changes in the segmentation. >> >> >> We find that neither head_contr.fmesh nor brain_contr.fsmesh have >> changed, but that only SubID_final_contr.nii gets changed. Is this >> file the one that gets used during electrical field modelling? We are >> unsure whether we have corrected the segmentation errors sufficiently >> for it to improce the electrical field modelling doen by SimNIBS. >> >> >> (These steps are illustrated here: >> https://simnibs.github.io/simnibs/build/html/documentation/command_line/headreco.html?highlight=headreco+surfacemesh >> ) >> >> >> Thank you very much for your assistance once again ? >> >> >> Best Regards, >> Daniela Rodriguez >> >> ------------------------------------------------------------------------ >> *From:* Rodriguez Manrique, Daniela >> *Sent:* 31 August 2022 10:55:33 >> *To:* Oula; support at simnibs.org >> *Subject:* Re: Issues with FreeView related to SimNIBS >> >> Hi Oula, >> >> >> that in deed was the solution! Thanks so much for hekping us out. >> >> >> Best Regards, >> >> >> Daniela Rodriguez M. >> >> ------------------------------------------------------------------------ >> *From:* Oula >> *Sent:* 30 August 2022 07:55:53 >> *To:* Rodriguez Manrique, Daniela; support at simnibs.org >> *Subject:* Re: Issues with FreeView related to SimNIBS >> >> Hi Daniela, >> >> >> Sorry for the late reply.? It seems that freeview in fs v7.1.1 does >> not work as it used to and closes down immediately after opening. >> >> >> If you use freeview from fs v6.0.0 that should work. >> >> >> Best, >> Oula >> >> >> On 8/17/22 14:42, Rodriguez Manrique, Daniela wrote: >>> >>> Dear Oula, >>> >>> Indeed, I do not see these files. What could the reason for them >>> missing? Freesurfer home is set to the version 7.1.1. >>> >>> I see the files wm_fromMesh.nii.gz gm_fromMesh.nii.gz unsure whether >>> these are realted. >>> >>> >>> Thank you for your help, >>> >>> Daniela Rodriguez >>> >>> ------------------------------------------------------------------------ >>> *From:* Oula >>> *Sent:* 15 August 2022 08:29:55 >>> *To:* Rodriguez Manrique, Daniela; support at simnibs.org >>> *Subject:* Re: Issues with FreeView related to SimNIBS >>> >>> Hi Daniela, >>> >>> >>> Do you see these files in the m2m-folder: brain_contr.fsmesh >>> head_contr.fsmesh? >>> >>> >>> -Oula >>> >>> >>> On 8/13/22 17:23, Rodriguez Manrique, Daniela wrote: >>>> >>>> Hi Oula, >>>> >>>> >>>> no worries. >>>> >>>> >>>> I do not see any errors in the terminal when I run the check >>>> command. However, it only opens one of the windows and I am unsure >>>> where to change this setting as the terminal gives me no >>>> information about this or error message. >>>> >>>> >>>> Best Regards, >>>> >>>> Daniela >>>> >>>> ------------------------------------------------------------------------ >>>> *From:* Oula >>>> *Sent:* 25 July 2022 09:38:09 >>>> *To:* Rodriguez Manrique, Daniela; support at simnibs.org >>>> *Subject:* Re: Issues with FreeView related to SimNIBS >>>> >>>> Hi Daniela, >>>> >>>> >>>> Sorry for the late reply, the SimNIBS team was on vacation. >>>> >>>> >>>> When you run the check command do you see any errors in the >>>> terminal? The check command actually should open two windows: one >>>> showing the colored segmentation results and the other one showing >>>> the MNI transformation. The screenshot you sent is showing the MNI >>>> transformation results. It seems for some reason the first window >>>> did not open or was closed. The terminal output will likely give >>>> some clues to why this might be. >>>> >>>> >>>> Best, >>>> Oula >>>> >>>> >>>> On 7/5/22 15:43, Rodriguez Manrique, Daniela wrote: >>>>> >>>>> Dear SimNIBS support, >>>>> >>>>> >>>>> first of all apologies for emailing developers of SimNIBS >>>>> seperately, I was not aware of this email address. >>>>> >>>>> >>>>> I have some questions regarding FreeView in the SimNiBS Pipeline. >>>>> >>>>> >>>>> To check the segmentation we use the command "headreco check >>>>> " as instructed below. This would open up the FreeView >>>>> window and show us the different matrixes for different materials >>>>> in different colours (also as seen below). >>>>> >>>>> >>>>> This was the case for a long time with my previous intern. She was >>>>> able to edit the segmentation and re-run it when finding errors. >>>>> Now for some reason, however, when using the same command, a >>>>> different window opens where no coloured matrixes are shown (see >>>>> second picture below). I have noted that both versions of FreeView >>>>> are the same (FreeView 3.0). Additionally previous subjects where >>>>> it once was possible to edit the segmentation, no longer show the >>>>> coloured matrixes. >>>>> >>>>> >>>>> Have you encountered this problem before? Or do you have any >>>>> pointers on what might be happening here? Even upon >>>>> re-installation of FreeSurfer I am not able to obtain the coloured >>>>> matrixes and have not found much information online. >>>>> >>>>> >>>>> Thank you for taking the time to read my email. >>>>> >>>>> >>>>> Best Regards, >>>>> >>>>> Daniela Rodriguez >>>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pastedImage.png Type: image/png Size: 473774 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pastedImage.png Type: image/png Size: 277402 bytes Desc: not available URL: From mgpell at gmail.com Wed Jan 4 09:43:11 2023 From: mgpell at gmail.com (Micki Gaby Pell) Date: Wed, 4 Jan 2023 10:43:11 +0200 Subject: [Simnibs-discuss] issues with installation (petsc_solver) and also meshfix-charm error Message-ID: Hi. Two questions please. 1) I am having problems installing simnibs-4.0 on a PC. Installation fails with the following error: ImportError DLL load failed while importing petsc_solver. The specified procedure could not be found. 2) When running charm on a PC with simnibs-4.0 successfully installed, the process is failing towards the end with the following error related to meshfix: [ simnibs ]INFO: Ensure CSF [ simnibs ]INFO: Starting surface creation 0 [main] meshfix 3044 C:\Users\pell10\SimNIBS-4.0\simnibs_env\Lib\site-packages\simnibs\external\bin\win\meshfix.exe: *** fatal error - add_item ("\??\C:\Users\pell10\SimNIBS-4.0\simnibs_env\Lib\site-packages\simnibs\external\bin", "/", ...) failed, errno 1 [ simnibs ]CRITICAL: Uncaught exception subprocess.CalledProcessError: Command '['C:\\Users\\pell10\\SimNIBS-4.0\\simnibs_env\\python.exe', 'C:\\Users\\pell10\\SimNIBS-4.0\\simnibs_env\\Lib\\site-packages\\simnibs\\segmentation\\run_cat_multiprocessing.py', '--Ymf', 'C:\\Users\\pell10\\Downloads\\structural\\m2m_110411\\surfaces\\norm_image.nii.gz', '--Yleft_path', 'C:\\Users\\pell10\\Downloads\\structural\\m2m_110411\\surfaces\\hemi_mask.nii.gz', '--Ymaskhemis_path', 'C:\\Users\\pell10\\Downloads\\structural\\m2m_110411\\surfaces\\cereb_mask.nii.gz', '--surface_folder', 'C:\\Users\\pell10\\Downloads\\structural\\m2m_110411\\surfaces', '--fsavgdir', 'C:\\Users\\pell10\\SimNIBS-4.0\\simnibs_env\\Lib\\site-packages\\simnibs\\resources\\templates\\fsaverage_surf', '--surf', 'lh', 'rh', '--pial', 'lh', 'rh', '--vdist', '1.0', '0.75', '--voxsize_pbt', '0.5', '0.25', '--voxsizeCS', '0.75', '0.5', '--th_initial', '0.714', '--no_intersect', 'True', '--nprocesses', '2']' returned non-zero exit status 1. Any suggestions what might be causing these two problems? Thanks Gaby BrainsWay and Ben Gurion University -------------- next part -------------- An HTML attachment was scrubbed... URL: From oulap at drcmr.dk Thu Jan 5 16:55:18 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Thu, 05 Jan 2023 16:55:18 +0100 Subject: [Simnibs-discuss] simnibs 4: numpy singular matrix error In-Reply-To: References: Message-ID: Hi Asif, Could you maybe send the charm_report.html to support at simnibs.org so I can have a look? Also if you're using a script to run the simulation please include that as well. Thanks, Oula On Mon, 2022-12-19 at 13:33 -0500, Asif Jamil wrote: > Hello- > > I?m using simnibs 4 to perform tDCS e-field simulation, and part of > the pipeline is to calculate the E-field normal component on the > fsaverage surface.? > > For most of my subjects, the pipeline runs fine, however for one > participant, I?m getting the following error: > > [ simnibs ]INFO: Interpolating to the middle of Gray Matter > [ simnibs ]CRITICAL: Uncaught exception > numpy.linalg.LinAlgError: Singular matrix > > Seems like this issue is related to there being a singular matrix. Is > there a quick workaround to this error? > > Thanks > Asif > > > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From oulap at drcmr.dk Thu Jan 5 17:01:51 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Thu, 05 Jan 2023 17:01:51 +0100 Subject: [Simnibs-discuss] ROI analysis In-Reply-To: References: Message-ID: Hi Silvana, It seems that you're not loading the central surface mesh. In your script the file is called: 'mni_icbm152_t1_tal_TDCS_1_scalar.msh' whereas in the example the file that is loaded is?fullfile('tdcs_simu','subject_overlays', 'ernie_TDCS_1_scalar_central.msh'). Can you double-check that you're using the correct file from inside the subject_overlays folder and re-run your script?? Thanks, Oula On Mon, 2022-12-19 at 11:59 +0100, Silvana Huertas wrote: > Hi,? > ? > I have been trying to do a ROI analysis using surface, as in your > page? > https://simnibs.github.io/simnibs/build/html/tutorial/analysis.html. > I copied your example and changed the mesh to mine. I interpolated my > mesh to the surface, using map_to_surface when I run the simulation. > However, when I try to do the ROI analysis, I get an error in the > line?head_mesh.node_data{end}.name = region_name. The error says that > we can't find the lh.4 region. I do not understand why this error > happens.? > ? > Could you help me, please? Below you can see my code > ? > sub=fullfile(foldersPath(time).folder,foldersPath(time).name,'mni_icb > m152_t1_tal_TDCS_1_scalar.msh'); > head_mesh = mesh_load_gmsh4(sub); > pwd='C:\Users\Workspace-user\Documents\...\mni_icbm152_nlin_sym_09a'; > [labels, snames] = subject_atlas(head_mesh, fullfile(pwd, > 'm2m_mni_icbm152_t1_tal\'), 'HCP_MMP1'); > ?region_name = 'lh.4'; > roi_idx=find(strcmpi(snames, region_name)); > node_idx = labels.node_data{end}.data==roi_idx; > % Plot the ROI > head_mesh.node_data{end+1}.data = int8(node_idx); > head_mesh.node_data{end}.name = region_name; > mesh_show_surface(head_mesh, 'field_idx', region_name) > ? > Thank you for your help,? > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From oulap at drcmr.dk Thu Jan 5 17:08:41 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Thu, 05 Jan 2023 17:08:41 +0100 Subject: [Simnibs-discuss] Testing SIMNIBS 4.0 In-Reply-To: <112A5E9E-2E88-479D-8746-C1621985492A@mail.ubc.ca> References: <112A5E9E-2E88-479D-8746-C1621985492A@mail.ubc.ca> Message-ID: <130b416bff86ff63add8e03363ea378a61efa4e9.camel@drcmr.dk> Hi Fidel, Could you send some information on what kind of system you're running SimNIBS 4 on? Is it on a cluster or a personal computer, what type of operating system you're using, and the specs of the computer. Can you additionally also send the command you used to run charm? Thanks, Oula On Tue, 2022-12-13 at 06:22 +0000, Vila-Rodriguez, Fidel wrote: > Hi, > I?m testing SIMNIBS 4.0 in a handful of subjects, and in all of them > I get the same type of error (terminal console capture below) that I > cannot see on the charm_log.htlm report (one attached here for > reference) > Any insights would be much appreciated. > Thanks and best regards, > Fidel > > > Incorrect guard value: 4586839698203395468 > python(66712,0x30989c000) malloc: *** set a breakpoint in > malloc_error_break to debug > python(66712,0x30958a000) malloc: Heap corruption detected, free list > is damaged at 0x6000001e3f00 > *** Incorrect guard value: 0 > python(66712,0x30958a000) malloc: *** set a breakpoint in > malloc_error_break to debug > /Users/mandelbrot/Applications/SimNIBS-4.0/bin/charm: line 2: 66712 > Abort trap: 6 ? ? ? ? ? "/Users/mandelbrot/Applications/SimNIBS- > 4.0/simnibs_env/bin/python" -E -u > "/Users/mandelbrot/Applications/SimNIBS- > 4.0/simnibs_env/lib/python3.9/site-packages/simnibs/cli/charm.py > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From oulap at drcmr.dk Thu Jan 5 17:29:47 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Thu, 05 Jan 2023 17:29:47 +0100 Subject: [Simnibs-discuss] error while using charm (instead of headreco) In-Reply-To: References: Message-ID: <339eb9c19f61bceb39815bf24794b8a654f72626.camel@drcmr.dk> Hi Maria, It seems that there's some sort of a dimensionality issue with the scans: ValueError: could not broadcast input array from shape (179,235,168) into shape (179,) Could you please inspect the T1.nii.gz and the T2_reg.nii.gz in a viewer, e.g., freeview or fsleyes, to check that they look okay? Thanks, Oula On Fri, 2022-12-09 at 02:40 +0000, Nazarova, Mariia wrote: > Dear colleagues, > I`m sorry for bothering! I was really excited about the release of > the new segmentation algorithm and tried to use charm for the first > time. Then I have the following error (attached). I`m quite an > inexperienced Linux user, may you please help me to solve it? > Thank you so much in advance! > Best, > Maria > The information in this e-mail is intended only for the person to > whom it is addressed.? If you believe this e-mail was sent to you in > error and the e-mail contains patient information, please contact the > Mass General Brigham Compliance HelpLine at > https://www.massgeneralbrigham.org/complianceline . > > Please note that this e-mail is not secure (encrypted).? If you do > not wish to continue communication over unencrypted e-mail, please > notify the sender of this message immediately.? Continuing to send or > respond to e-mail after receiving this message means you understand > and accept this risk and wish to continue to communicate over > unencrypted e-mail.? > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From sean at rogue-research.com Fri Jan 6 01:14:42 2023 From: sean at rogue-research.com (Sean McBride) Date: Thu, 05 Jan 2023 19:14:42 -0500 Subject: [Simnibs-discuss] "The qform and sform of do not match..." why this requirement? Message-ID: <131224E8-4F2C-48F2-9D00-08E8A23E2663@rogue-research.com> Hi all, I notice here: https://github.com/simnibs/simnibs/blob/8fe54625a6d5b523456a4bf2efb24b890ee05fdb/simnibs/segmentation/charm_main.py#L661 The error message "The qform and sform of do not match. Please run charm with the --forceqform option". Why are the qform and sform expected/required to match? Also: there is a stray "of" in that error message text. Thanks, Sean From oulap at drcmr.dk Fri Jan 6 15:03:53 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Fri, 06 Jan 2023 15:03:53 +0100 Subject: [Simnibs-discuss] "The qform and sform of do not match..." why this requirement? In-Reply-To: <131224E8-4F2C-48F2-9D00-08E8A23E2663@rogue-research.com> References: <131224E8-4F2C-48F2-9D00-08E8A23E2663@rogue-research.com> Message-ID: <7e4e2a15e260e1bd65c4ef57888abb001df946e5.camel@drcmr.dk> Hi Sean, Techincally they don't have to match, but it that seems different nifti readers sometimes use one and sometimes the other, which can cause problems. We decided it's best to explicitly "force" the qform to keep everything consistent within charm. As the qform should store the transformation from voxels to scanner coordinates, i.e., no shears, we decided to go with that. Best, Oula On Thu, 2023-01-05 at 19:14 -0500, Sean McBride wrote: > Hi all, > > I notice here: > > https://github.com/simnibs/simnibs/blob/8fe54625a6d5b523456a4bf2efb24b890ee05fdb/simnibs/segmentation/charm_main.py#L661 > > The error message "The qform and sform of do not match. Please run > charm with the --forceqform option". > > Why are the qform and sform expected/required to match? > > Also: there is a stray "of" in that error message text. > > Thanks, > > Sean > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From oulap at drcmr.dk Fri Jan 6 15:20:11 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Fri, 06 Jan 2023 15:20:11 +0100 Subject: [Simnibs-discuss] ***Suspected SPAM*** Re: Problem with editing segmentation results In-Reply-To: <92497AD4-8741-4F27-977F-A1EE97810DFF@campus.lmu.de> References: <92497AD4-8741-4F27-977F-A1EE97810DFF@campus.lmu.de> Message-ID: Hi G?lce, If the file called _final_contr.nii changes according to your edits then you have succesfully managed to propagate the manual edits to the mesh file. The two other files, namely head_contr.fsmesh and brain_contr.fsmesh, are generated by the headreco --check call. You should be able to re- create those by first removing them and then re-running the check call. You might have to also remove the .msh file and re-run the volumemeshing step for the changes to propagate to the fsmesh files. The editing in headreco works *only* when the --no-cat flag is used. In the newest version of SimNIBS manual edits are easier to make, but note that the new version is not backwards compatible, i.e., you need to use the new headmodel generation pipeline called charm in that case. Best, Oula On Fri, 2022-12-30 at 15:13 +0100, G?lce Lale wrote: > Hello, > I?ve been editing my segmentation results with Freeview following the > instructions on this > page:?https://simnibs.github.io/simnibs/build/html/documentation/comm > and_line/headreco.html?My aim is to correct the CSF since it > overflows to bone in some of the segmentations. After I edit the > segmentation on the binary mask in the /mask_prep folder (in this > case MASK_CSF.nii.gz), I run headreco surfacemesh and headreco > volumemesh, the colors of the segmentation changes, these are saved > in?, SubID_final_contr.nii file.?However, the lines saved in > head_contr.fmesh and brain_contr.fmesh?that define the boundary > between bone and CSF are not changing. > I tried to do these steps with CAT12 as well as without CAT12, with - > -no -cat command. However, both of them resulted in the same way. Am > I successfully?editing the segmentation so that the magnetic field > simulation done by SimNIBS will use the correct tissue borders??Or, > do I have to apply something else in order to edit the line > boundaries as well? > Thank you for your help and answers in advance. > Best wishes, > G?lce > > G?lce Lale > MSc Neurosciences > > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From andrew.westbrook at brown.edu Fri Jan 6 21:01:00 2023 From: andrew.westbrook at brown.edu (Westbrook, Andrew) Date: Fri, 6 Jan 2023 15:01:00 -0500 Subject: [Simnibs-discuss] Trouble exporting to Brainsight Message-ID: Hello SimNIBS Team, I am attempting to export my TMS Optimization results (estimated via the ADM method) to a Brainsight-readable .xml file, but I am getting the following error when I try to execute brainsight().write(opt_mat, fn) [ simnibs ]CRITICAL: Uncaught exception AssertionError: Expecting array with shape (4, 4, N instrument marker). As you can see in the following python script (appended below), I am using a standard set of arguments to set up my optimization routine, so I don't know why the export function isn't working. Everything seems to function properly up until the brainsight().write call. Would you please help me address this issue? Note that the optimization itself appears to execute without error. Also, FWIW, I am running on Mac OS Big Sur 11.7, and I just recently installed my version of SimNIBS (last week). Thank you, Andrew === import os import sys from simnibs import sim_struct, opt_struct, brainsight, mni2subject_coords fn = "precomputed_coilpos.xml" ### export from np.ndarray / matsimnibs tms_opt = opt_struct.TMSoptimize() # ... prepare optmization ... # Subject folder tms_opt.subpath = 'm2m_105' # Select output folder tms_opt.pathfem = 'tms_optimization_adm' # Select the coil model # The ADM method requires a '.ccd' coil model tms_opt.fnamecoil = os.path.join('legacy_and_other','Magstim_70mm_Fig8.ccd') # Select a target for the optimization and other params tms_opt.target = mni2subject_coords([-42, 13, 33], 'm2m_105') tms_opt.distance = 6.0 # mm # Use the ADM method tms_opt.method = 'ADM' tms_opt.open_in_gmsh = False opt_mat = tms_opt.run() # get optimal position brainsight().write(opt_mat, fn) === -- Andrew Westbrook Post-Doctoral Research Associate Department of Cognitive, Linguistics, and Psychological Sciences Brown University 190 Thayer Street Providence, RI 02912 Cell: +1-919-360-5399 -------------- next part -------------- An HTML attachment was scrubbed... URL: From augustin.moreau2 at chru-strasbourg.fr Mon Jan 9 08:24:39 2023 From: augustin.moreau2 at chru-strasbourg.fr (MOREAU Augustin (CEMNIS)) Date: Mon, 9 Jan 2023 07:24:39 +0000 Subject: [Simnibs-discuss] Questions regarding electric fields and simulation Message-ID: <61A4FEB6F3155F4695499818F09FC20E4E0600@EXCH-B01.hus.chru-strasbourg.fr> Hello, I'm an engineer working currently at the CEMNIS at the Strasbourg University Hospitals (Hopitaux Universitaire de Strasbourg) and the University of Strasbourg. I've been using SimNIBS for several weeks now, and I have several questions concerning the simulations : 1) Is the calculation during the simulation (and the results that we can see) takes into account secondary electric fields (in addition of the primary electric fields) ? 1.1) If yes, is it possible to see the results in the cerebrospinal fluid (to see how the fields propagate in this zone) ? Is it possible to make the separation between primary and secondary eletric fields and see the results in the CSF ? 1.2) If no, do you know someone who did this or a reference in the litterature ? Does it have an interest to see the results of secondary electrid fields ? Thank you for your time. Sincerely yours, Augustin Moreau. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kristofferm at drcmr.dk Mon Jan 9 23:24:10 2023 From: kristofferm at drcmr.dk (Kristoffer Madsen) Date: Mon, 9 Jan 2023 23:24:10 +0100 Subject: [Simnibs-discuss] Questions regarding electric fields and simulation In-Reply-To: <61A4FEB6F3155F4695499818F09FC20E4E0600@EXCH-B01.hus.chru-strasbourg.fr> References: <61A4FEB6F3155F4695499818F09FC20E4E0600@EXCH-B01.hus.chru-strasbourg.fr> Message-ID: I assume that you are referring to TMS stimulation - right? It is a bit unclear to me what you mean by primary and secondary electrical field. Sometimes this distinction is made as a theoretical partitioning of the field due to the current in the coil, and charge accumulation in the head due to change in conductivity. SimNIBS calculates the effective electrical field based on the Poisson equation where the dA/dt field (equivalent to the E-field in an infinite homogeneous conductor with appropriate scaling) is used to determine the RHS. In TMS eddy currents are effectively negligible so these are ignored in the estimation which we typically base on a dipole model (ccd file) or the A field determined in a volume (.nii.gz file). I am unsure if simNIBS currently enables outputting the dA/dt field directly (I think there was a request at some point but cant remember if it was filled). Anyways you can easily determine it as it is independent of the head model. So in short I believe that simNIBS currently does not directly allow this separation to be made, but it should be relatively easy to do it using simNIBS with a bit of scripting (also for CSF). However, I am still not very sure what information would really be gained from having this separation of the field. Best, Kristoffer On Mon, 9 Jan 2023 at 17:00, MOREAU Augustin (CEMNIS) wrote: > > Hello, > > > > I'm an engineer working currently at the CEMNIS at the Strasbourg University Hospitals (Hopitaux Universitaire de Strasbourg) and the University of Strasbourg. I've been using SimNIBS for several weeks now, and I have several questions concerning the simulations : > > > > 1) Is the calculation during the simulation (and the results that we can see) takes into account secondary electric fields (in addition of the primary electric fields) ? > > > > 1.1) If yes, is it possible to see the results in the cerebrospinal fluid (to see how the fields propagate in this zone) ? Is it possible to make the separation between primary and secondary eletric fields and see the results in the CSF ? > > 1.2) If no, do you know someone who did this or a reference in the litterature ? Does it have an interest to see the results of secondary electrid fields ? > > > > > > Thank you for your time. > > > > > > Sincerely yours, > > > > Augustin Moreau. > > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From danmccalley at stanford.edu Thu Jan 12 01:30:24 2023 From: danmccalley at stanford.edu (Daniel McCalley) Date: Thu, 12 Jan 2023 00:30:24 +0000 Subject: [Simnibs-discuss] "Value Error" in charm pipeline - same issue as posted in December Message-ID: Hi all, I'm writing to report a similar instance of an error using the new Charm pipeline. The issue is nearly identical to the one Mariia Nazarova posted to the boards in December. I saw that Oula had followed up asking to take a peek at the T1 itself to see if there are any obvious issues. I have the same issue as Mariia (charm_log attached) and specific error pasted below. I reviewed my anatomical scans and did not find any obvious issues (screenshot below as well). ValueError: could not broadcast input array from shape (175,255,256) into shape (175,255,256,1) CRITICAL: Uncaught exception ValueError: could not broadcast input array from shape (175,255,256) into shape (175,255,256,1) Happy to share a T1 that did and did not work through the charm pipeline if that would be helpful for troubleshooting! Best, Dan McCalley, Ph.D. Postdoctoral Scholar, Padula BRAVE lab Stanford University School of Medicine, Psychiatry and Behavioral Sciences (he/him) -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot 2023-01-11 at 4.29.27 PM.png Type: image/png Size: 1308842 bytes Desc: Screenshot 2023-01-11 at 4.29.27 PM.png URL: From oulap at drcmr.dk Thu Jan 12 14:27:03 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Thu, 12 Jan 2023 14:27:03 +0100 Subject: [Simnibs-discuss] "Value Error" in charm pipeline - same issue as posted in December In-Reply-To: References: Message-ID: <1b94b947788b1473c69cdadf16bcff7eb27318c2.camel@drcmr.dk> Hi Dan, Can you make sure that the input T1 (or scans in general) does not have any extra singleton dimensions, e.g., shape (175,255,256,1)? If it does just squeeze it out, write the scan back to disk and try again. I thought we had caught all these cases, but seems that might not be the case. We'll add this one to the list of bugs to fix. Best, Oula On Thu, 2023-01-12 at 00:30 +0000, Daniel McCalley wrote: > Hi all,? > > I'm writing to report a similar instance of an error using the new > Charm pipeline. The issue is nearly identical to the one Mariia > Nazarova posted to the boards in December. I saw that Oula had > followed up asking to take a peek at the T1 itself to see if there > are any obvious issues.? > > I have the same issue as Mariia (charm_log attached) and specific > error pasted below. I reviewed my anatomical scans and did not find > any obvious issues (screenshot below as well).? > ValueError: could not broadcast input array from shape (175,255,256) > into shape (175,255,256,1) > CRITICAL: Uncaught exception > ValueError: could not broadcast input array from shape (175,255,256) > into shape (175,255,256,1) > Happy to share a T1 that did and did not work through the charm > pipeline if that would be helpful for troubleshooting!? > > Best,? > > Dan McCalley, Ph.D. > Postdoctoral Scholar, Padula BRAVE lab > Stanford University > School of Medicine, Psychiatry and Behavioral Sciences? > (he/him) > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From danmccalley at stanford.edu Thu Jan 12 20:02:34 2023 From: danmccalley at stanford.edu (Daniel McCalley) Date: Thu, 12 Jan 2023 19:02:34 +0000 Subject: [Simnibs-discuss] Availability of previous SimNibs 3.0 versions for download Message-ID: Hi all, I noticed in the available earlier versions of SimNIBS page only versions 2.X are listed. I have some ongoing projects using the 3.2 version and would like to be able to spread the jobs across multiple machines -- would you all be able to upload the installers for this version to the archive page? (listed here: https://simnibs.drcmr.dk/simnibs-download/category/3-simnibs-earlier-versions) -- Please let me know if I'm overlooking something and this is already available! Best, Dan McCalley, Ph.D. Postdoctoral Scholar, Padula BRAVE lab Stanford University School of Medicine, Psychiatry and Behavioral Sciences (he/him) -------------- next part -------------- An HTML attachment was scrubbed... URL: From roch at rogue-research.com Fri Jan 13 20:43:29 2023 From: roch at rogue-research.com (Roch M. Comeau) Date: Fri, 13 Jan 2023 14:43:29 -0500 Subject: [Simnibs-discuss] Questions about changes in SimNIBS 4 Message-ID: <71FC9DFD-43EA-431A-931C-1C83DDD3B6CA@rogue-research.com> First of all, thank you for continuing to evolve this wonderful tool for the brain stimulation community! I am in the process of updating our navigator to support the changes in SimNIBS 4 and have a few questions. I hope this forum is the right place as others may have the same questions? Background: Brainsight implemented some basic support for SimNIBS by adding some UI elements in the Targeting window to allow one to easily perform a simulation within the familiar workflow. The project is created by selecting the mesh file that is the output of the segmentation pipeline (charm as of 4.0) and we automatically load the mesh, separate the surfaces and append them to our reconstructions list, load the T1 MRI and the MNI transform. This allows the users to visualize the 3D surfaces in addition to the surfaces one would normally create in Brainsight. We added some UI elements in the target step including a popup to select the coil (from the SimNIBS list), the stimulation intensity and a simulate button. One creates a trajectory as they normally would (or a grid), enters the input parameters and clicks the simulate button. Brainsight writes a python script, invokes simnibs_python, waits for the results (asynchronous one day?) and adds the NIfTI interpolated volumes to the overlays and uses this to texture map all the surfaces as well as to draw the current direction arrows. In adapting to SimNIBS 4, I am encountering a few issues that someone might be able to help me with: 1: In earlier versions of SimNIBS, there was a registration to MNI space called ?MNI2conform_12DOF.txt? in the ?ToMNI? folder. This seems to not be there anymore. Was this removed, or do I need to add a flag to the script to generate this? This is not critical, but I wanted to ask. 2: The interpolated volumes (generated by adding ?s.map_to_vol=True? to the script seem now to be masked to the grey matter. For us this is problematic for the texture mapping because we catch a lot of the 0 values adjacent to the mesh vertices. Was this s change, or is there a flag I am missing to have the interpolation for the whole brain volume (or amore permissive mask)? The attached image shows the interpolated results on the 2D views as well as texture mapped on 2 versions of the grey matter. The bottom right is the original surface from the charm pipeline (extracted from the gmsh) and the upper left was generated from the tissue mask with a lot of smoothing which has the effect of eroding the surface a bit so the vertices are more reliably within the masked volume (so the texture map has fewer 0 values). Thanks for any pointers anyone might be able to share. Regards, Roch ? Roch M. Comeau, Ph.D. President, Rogue Research Inc. 6666 St-Urbain, Suite 300 Montreal, QC, Canada, H2S 3H1 Phone:(514)284-3888, Fax: (514)284-6750 roch at rogue-research.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 37E61B6E-256C-4D33-9C8F-0C9CA17F5C5E.png Type: image/png Size: 893393 bytes Desc: not available URL: From shiima at kuhp.kyoto-u.ac.jp Sun Jan 15 13:20:01 2023 From: shiima at kuhp.kyoto-u.ac.jp (Atsushi Shima) Date: Sun, 15 Jan 2023 21:20:01 +0900 Subject: [Simnibs-discuss] Brainstem visualization Message-ID: Dear SimNIBS Team, Thank you for the wonderful program. I have a couple of questions. I would like to visualize the brainstem. The pipeline of "charm" seems working well. However, when we see the results with gmsh, there is a lack of the brainstem. I also tried the test data (ernie m2m), however, I could see the brainstem. Is it possible to visualize the brainstem in SimNIBS version 4.0.0? (I could see the previous papers describing the brainstem by v2 or 3.) I appreciate your help. Sincerely, Atsushi Shima -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at rogue-research.com Fri Jan 13 21:38:53 2023 From: sean at rogue-research.com (Sean McBride) Date: Fri, 13 Jan 2023 15:38:53 -0500 Subject: [Simnibs-discuss] "The qform and sform of do not match..." why this requirement? In-Reply-To: <7e4e2a15e260e1bd65c4ef57888abb001df946e5.camel@drcmr.dk> References: <131224E8-4F2C-48F2-9D00-08E8A23E2663@rogue-research.com> <7e4e2a15e260e1bd65c4ef57888abb001df946e5.camel@drcmr.dk> Message-ID: <39B9F362-3F58-4A4B-9DEF-4D5471786338@rogue-research.com> Oula, Thanks for your reply, sorry for my delayed response. So we have a nifti file where simnibs gives "the qform and sform of do not match". This file has a `qform_code` of `NIFTI_XFORM_UNKNOWN` (0), and an `sform_code` of `NIFTI_XFORM_SCANNER_ANAT` (1). Usually, when you encounter NIFTI_XFORM_UNKNOWN in either the sform or qform, you should ignore it. The `--forceqform` option is not helpful here because it's the qform that is `NIFTI_XFORM_UNKNOWN`. There appears to be no way to make SimNIBS use the sform. I would suggest that: 1) SimNIBS should look at the `[qs]form_code` value and ignore any `NIFTI_XFORM_UNKNOWN`. If you are then left with only one, there's no need to even check if they match. and/or 2) add a `--forcesform` option Cheers, Sean On 6 Jan 2023, at 9:03, Oula Puonti wrote: > Hi Sean, > > Techincally they don't have to match, but it that seems different > nifti > readers sometimes use one and sometimes the other, which can cause > problems. We decided it's best to explicitly "force" the qform to keep > everything consistent within charm. As the qform should store the > transformation from voxels to scanner coordinates, i.e., no shears, we > decided to go with that. > > Best, > Oula > > > On Thu, 2023-01-05 at 19:14 -0500, Sean McBride wrote: >> Hi all, >> >> I notice here: >> >> https://github.com/simnibs/simnibs/blob/8fe54625a6d5b523456a4bf2efb24b890ee05fdb/simnibs/segmentation/charm_main.py#L661 >> >> The error message "The qform and sform of do not match. Please run >> charm with the --forceqform option". >> >> Why are the qform and sform expected/required to match? >> >> Also: there is a stray "of" in that error message text. >> >> Thanks, >> >> Sean >> _______________________________________________ >> Simnibs-discuss mailing list >> Simnibs-discuss at drcmr.dk >> https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss -------------- next part -------------- An HTML attachment was scrubbed... URL: From oulap at drcmr.dk Fri Jan 13 22:01:22 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Fri, 13 Jan 2023 22:01:22 +0100 Subject: [Simnibs-discuss] "The qform and sform of do not match..." why this requirement? In-Reply-To: <39B9F362-3F58-4A4B-9DEF-4D5471786338@rogue-research.com> References: <131224E8-4F2C-48F2-9D00-08E8A23E2663@rogue-research.com> <7e4e2a15e260e1bd65c4ef57888abb001df946e5.camel@drcmr.dk> <39B9F362-3F58-4A4B-9DEF-4D5471786338@rogue-research.com> Message-ID: Hi Sean, Makes sense, we'll add an option to use the sform. I guess for now you'll have to copy the sform to the qform before calling simnibs. -Oula On Fri, 2023-01-13 at 15:38 -0500, Sean McBride wrote: > NIFTI_XFORM_UNKNOWN From oulap at drcmr.dk Mon Jan 16 23:59:13 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Mon, 16 Jan 2023 23:59:13 +0100 Subject: [Simnibs-discuss] Brainstem visualization In-Reply-To: References: Message-ID: <0d5cedf2e25d0dc801e8135d7684aab966f68594.camel@drcmr.dk> Hi Atsushi, Are you trying to create a separate label for the brain stem? It should be part of the white matter in the standard charm output. You said that you can see the brain stem on ernie, so I'm wondering if something went wrong when you ran the specific subject where you cannot see the brain stem. Could you maybe send us a screenshot showing the problem? Thanks, Oula On Sun, 2023-01-15 at 21:20 +0900, Atsushi Shima wrote: > ?Dear SimNIBS Team, > > Thank you for the wonderful program. I have a couple of questions. > > I would like to visualize the brainstem. > The pipeline of "charm" seems working well. However, when we see the > results with gmsh, there is a lack of the brainstem. > I also tried the test data (ernie m2m), however, I could see the > brainstem. > > Is it possible to visualize the brainstem in SimNIBS version 4.0.0? > (I could see the previous papers describing the brainstem by v2 or > 3.) > I appreciate your help. > > Sincerely, > Atsushi Shima > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From oulap at drcmr.dk Tue Jan 17 00:42:40 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Tue, 17 Jan 2023 00:42:40 +0100 Subject: [Simnibs-discuss] Questions about changes in SimNIBS 4 In-Reply-To: <71FC9DFD-43EA-431A-931C-1C83DDD3B6CA@rogue-research.com> References: <71FC9DFD-43EA-431A-931C-1C83DDD3B6CA@rogue-research.com> Message-ID: Hi Roch, 1: There is an affine transformation from the charm atlas space to the image space, but that is now stored in? m2m_/segmentation/coregistrationMatrices.mat If you read the mat file you'll find the voxel-to-voxel transformation as well as the world-to-world transformation. The charm atlas lives in the MNI space, so the transformation should work for mapping stuff affinely from the MNI space to the subject space. 2: There's a simulation struct field called tissues_in_niftis, if you set this to 'all' in your simulation script, i.e., S.tissues_in_niftis = 'all' where S is S = sim_struct.SESSION(), you should get the e-field in the whole volume. See here for details: https://github.com/simnibs/simnibs/blob/master/simnibs/simulation/sim_struct.py#L78 Best, Oula On Fri, 2023-01-13 at 14:43 -0500, Roch M. Comeau wrote: > First of all, thank you for continuing to evolve this wonderful tool > for the brain stimulation community! I am in the process of updating > our navigator to support the changes in SimNIBS 4 and have a few > questions. I hope this forum is the right place as others may have > the same questions? > > Background: Brainsight implemented some basic support for SimNIBS by > adding some UI elements in the Targeting window to allow one to > easily perform a simulation within the familiar workflow. The project > is created by selecting the mesh file that is the output of the > segmentation pipeline (charm as of 4.0) and we automatically load the > mesh, separate the surfaces and append them to our reconstructions > list, load the T1 MRI and the MNI transform. This allows the users to > visualize the 3D surfaces in addition to the surfaces one would > normally create in Brainsight. We added some UI elements in the > target step including a popup to select the coil (from the SimNIBS > list), the stimulation intensity and a simulate button. One creates a > trajectory as they normally would (or a grid), enters the input > parameters and clicks the simulate button. Brainsight writes a python > script, invokes simnibs_python, waits for the results (asynchronous > one day?) and adds the NIfTI interpolated volumes to the overlays and > uses this to texture map all the surfaces as well as to draw the > current direction arrows. In adapting to SimNIBS 4, I am encountering > a few issues that someone might be able to help me with: > > 1: In earlier versions of SimNIBS, there was a registration to MNI > space called ?MNI2conform_12DOF.txt? in the ?ToMNI? folder. This > seems to not be there anymore. Was this removed, or do I need to add > a flag to the script to generate this? This is not critical, but I > wanted to ask. > > 2: The interpolated volumes (generated by adding ?s.map_to_vol=True? > to the script seem now to be masked to the grey matter. For us this > is problematic for the texture mapping because we catch a lot of the > 0 values adjacent to the mesh vertices. Was this s change, or is > there a flag I am missing to have the interpolation for the whole > brain volume (or ?amore permissive mask)? The attached image shows > the interpolated results on the 2D views as well as texture mapped on > 2 versions of the grey matter. The bottom right is the original > surface from the charm pipeline (extracted from the gmsh) and the > upper left was generated from the tissue mask with a lot of smoothing > which has the effect of eroding the surface a bit so the vertices are > more reliably within the masked volume (so the texture map has fewer > 0 values). > > Thanks for any pointers anyone might be able to share. > > Regards, > > Roch? > ?? > Roch M. Comeau, Ph.D. > President, > Rogue Research Inc. > 6666 St-Urbain, Suite 300 > Montreal, QC, Canada, H2S 3H1 > Phone:(514)284-3888, Fax: (514)284-6750 > roch at rogue-research.com > > > Screen Shot 2022-12-27 at 1.58.41 PM.png > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From oulap at drcmr.dk Tue Jan 17 00:46:23 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Tue, 17 Jan 2023 00:46:23 +0100 Subject: [Simnibs-discuss] Availability of previous SimNibs 3.0 versions for download In-Reply-To: References: Message-ID: <8b26ee26ea38763444c970af039bf7d1cd2e42f4.camel@drcmr.dk> Hi Daniel, For specific legacy versions it might be easiest to grab those from our github site: https://github.com/simnibs/simnibs/releases For the newest version please keep using the download link on the simnibs website. Best, Oula On Thu, 2023-01-12 at 19:02 +0000, Daniel McCalley wrote: > Hi all,? > > I noticed in the available earlier versions of SimNIBS page only > versions 2.X are listed. I have some ongoing projects using the 3.2 > version and would like to be able to spread the jobs across multiple > machines -- would you all be able to upload the installers for this > version to the archive page? (listed > here:?https://simnibs.drcmr.dk/simnibs-download/category/3-simnibs-ea > rlier-versions) -- Please let me know if I'm overlooking something > and this is already available!? > > Best, > > > Dan McCalley, Ph.D. > Postdoctoral Scholar, Padula BRAVE lab > Stanford University > School of Medicine, Psychiatry and Behavioral Sciences? > (he/him) > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From shiima at kuhp.kyoto-u.ac.jp Tue Jan 17 05:15:30 2023 From: shiima at kuhp.kyoto-u.ac.jp (Atsushi Shima) Date: Tue, 17 Jan 2023 13:15:30 +0900 Subject: [Simnibs-discuss] Brainstem visualization In-Reply-To: <0d5cedf2e25d0dc801e8135d7684aab966f68594.camel@drcmr.dk> References: <0d5cedf2e25d0dc801e8135d7684aab966f68594.camel@drcmr.dk> Message-ID: Dear Oula, Thank you for your reply. I wanted to display the results of the simulation on the brainstem, instead of creating labels for the brainstem. Similarly in Ernie, the brainstem was not displayed in the results. Do I need to process to display of the white matter in gmsh? I appreciate your help. Best, Atsushi [image: BS.png][image: BS2.png] 2023?1?17?(?) 7:59 Oula Puonti : > Hi Atsushi, > > Are you trying to create a separate label for the brain stem? It should > be part of the white matter in the standard charm output. > > You said that you can see the brain stem on ernie, so I'm wondering if > something went wrong when you ran the specific subject where you cannot > see the brain stem. > > Could you maybe send us a screenshot showing the problem? > > Thanks, > Oula > > > On Sun, 2023-01-15 at 21:20 +0900, Atsushi Shima wrote: > > Dear SimNIBS Team, > > > > Thank you for the wonderful program. I have a couple of questions. > > > > I would like to visualize the brainstem. > > The pipeline of "charm" seems working well. However, when we see the > > results with gmsh, there is a lack of the brainstem. > > I also tried the test data (ernie m2m), however, I could see the > > brainstem. > > > > Is it possible to visualize the brainstem in SimNIBS version 4.0.0? > > (I could see the previous papers describing the brainstem by v2 or > > 3.) > > I appreciate your help. > > > > Sincerely, > > Atsushi Shima > > _______________________________________________ > > Simnibs-discuss mailing list > > Simnibs-discuss at drcmr.dk > > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: BS2.png Type: image/png Size: 549133 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: BS.png Type: image/png Size: 534751 bytes Desc: not available URL: From elizabeth.gregory at ubc.ca Tue Jan 17 05:29:26 2023 From: elizabeth.gregory at ubc.ca (Gregory, Elizabeth) Date: Tue, 17 Jan 2023 04:29:26 +0000 Subject: [Simnibs-discuss] Install using Conda not working Message-ID: <4e217b9466c347aeba9f5a7c39473e06@ubc.ca> Hi there, I am currently attempting to install the latest simnibs using a Conda environment as outlined in the documentation (https://simnibs.github.io/simnibs/build/html/installation/conda.html). I keep getting the following error when attempting to run the line "pip install -f https://github.com/simnibs/simnibs/releases/latest simnibs" Looking in links: https://github.com/simnibs/simnibs/releases/latest ERROR: Could not find a version that satisfies the requirement simnibs (from versions: none) ERROR: No matching distribution found for simnibs I have tried to instead run variations such as "pip install -f https://github.com/simnibs/simnibs/releases/v4.0.0 simnibs", which gives the same error, and "pip install https://github.com/simnibs/simnibs/releases/v4.0.0", which gives the following error Collecting https://github.com/simnibs/simnibs/releases/v4.0.0 Downloading https://github.com/simnibs/simnibs/releases/v4.0.0 | 112.6 kB 853.2 kB/s 0:00:00 ERROR: Cannot unpack file /tmp/pip-unpack-_5sf34ih/v4.0.0 (downloaded from /tmp/pip-req-build-d2li2ds3, content-type: text/html; charset=utf-8); cannot detect archive format ERROR: Cannot determine archive format of /tmp/pip-req-build-d2li2ds3 I have tried doing the install on both mac and linux operating systems and the same error comes up. I installed an earlier version of simnibs (I believe v.3.2.6) less than 6 months ago using this same method and encountered no problems. I attempted to see if installing an earlier version would work (ie using "pip install -f https://github.com/simnibs/simnibs/releases/v3.2.6 simnibs") but the same errors come up - ie this is not isolated to the latest version. Please let me know if there is something I am missing in this process? Thank you so much for your time and help. Best, Elizabeth -------------- next part -------------- An HTML attachment was scrubbed... URL: From oulap at drcmr.dk Tue Jan 17 14:37:29 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Tue, 17 Jan 2023 14:37:29 +0100 Subject: [Simnibs-discuss] Brainstem visualization In-Reply-To: References: <0d5cedf2e25d0dc801e8135d7684aab966f68594.camel@drcmr.dk> Message-ID: Hi Atsushi, In gmsh if you select Tools -> Visibility, and then select WM in the tissues list (along with GM if you like) you should be able to see the brain stem. Best, Oula On Tue, 2023-01-17 at 13:15 +0900, Atsushi Shima wrote: > Dear Oula, > > Thank you for your reply. > I wanted to display the results of the simulation on the brainstem, > instead?of creating labels for the brainstem. > Similarly in Ernie, the brainstem was not displayed in the results. > Do I need to process to display of the white matter in gmsh? > I appreciate your help. > > Best, > Atsushi > BS.pngBS2.png > > 2023?1?17?(?) 7:59 Oula Puonti : > > Hi Atsushi, > > > > Are you trying to create a separate label for the brain stem? It > > should > > be part of the white matter in the standard charm output. > > > > You said that you can see the brain stem on ernie, so I'm wondering > > if > > something went wrong when you ran the specific subject where you > > cannot > > see the brain stem. > > > > Could you maybe send us a screenshot showing the problem? > > > > Thanks, > > Oula > > > > > > On Sun, 2023-01-15 at 21:20 +0900, Atsushi Shima wrote: > > > ?Dear SimNIBS Team, > > > > > > Thank you for the wonderful program. I have a couple of > > > questions. > > > > > > I would like to visualize the brainstem. > > > The pipeline of "charm" seems working well. However, when we see > > > the > > > results with gmsh, there is a lack of the brainstem. > > > I also tried the test data (ernie m2m), however, I could see the > > > brainstem. > > > > > > Is it possible to visualize the brainstem in SimNIBS version > > > 4.0.0? > > > (I could see the previous papers describing the brainstem by v2 > > > or > > > 3.) > > > I appreciate your help. > > > > > > Sincerely, > > > Atsushi Shima > > > _______________________________________________ > > > Simnibs-discuss mailing list > > > Simnibs-discuss at drcmr.dk > > > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss > > From G.Lale at campus.lmu.de Tue Jan 17 15:50:19 2023 From: G.Lale at campus.lmu.de (=?utf-8?Q?G=C3=BClce_Lale?=) Date: Tue, 17 Jan 2023 15:50:19 +0100 Subject: [Simnibs-discuss] tDCS electrode is being simulated as skin Message-ID: <666F1DDE-D746-4142-ACC0-D150B882A045@campus.lmu.de> Dear SimNIBS Team, We conduct post-hoc modelling for each subject using T1 and T2 images acquired while the participant was in the scanner with the tDCS electrodes attached. Here SimNIBS headreco images the 2mm layer of electrode paste and includes in in the head mesh but segments it as skin (see attached images). According to SimNIBS skin conductance is 0.465 s/m and the electrode material conductivity is 29.4 s/m. One would expect the Ten20 Electrode paste which is applied with a 2mm thickness between the electrode and skin to have a different measure. However, since it is being considered and modelled as skin this could results in deviations in the electric field modelling. How do we account/solve this? Could we model the electrodes 2mm below the head surface, knowing that the outer 2mm thickness of the skin are actually due to the paste? Thus, modelling the electrodes on the ?actual? skin outer layer (and not on top of the paste). SimNIBS then allows us to specify past + electrode thickness. Where we assume SimNIBS calculates a different conductivity measure for both. Is there an alternative solution to best account for the change of conductance? Thank you for your help in advance. Best wishes, G?lce G?lce Lale MSc Neurosciences -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image1.png Type: image/png Size: 178462 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image2.png Type: image/png Size: 422281 bytes Desc: not available URL: From oulap at drcmr.dk Tue Jan 17 15:59:16 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Tue, 17 Jan 2023 15:59:16 +0100 Subject: [Simnibs-discuss] Install using Conda not working In-Reply-To: <4e217b9466c347aeba9f5a7c39473e06@ubc.ca> References: <4e217b9466c347aeba9f5a7c39473e06@ubc.ca> Message-ID: <0a6a8646e41560bbf7ae96a8aa7e28509e29f127.camel@drcmr.dk> Hi Elizabeth, Thanks for reporting this, I'll have a look. For now you can pip install by directly passing the path to the correct .whl file. For example: pip install https://github.com/simnibs/simnibs/releases/download/v4.0.0/simnibs-4.0.0-cp39-cp39-linux_x86_64.whl Best, Oula On Tue, 2023-01-17 at 04:29 +0000, Gregory, Elizabeth wrote: > Hi there,? > > I am currently attempting to install the latest simnibs using a Conda > environment as outlined in the documentation > (https://simnibs.github.io/simnibs/build/html/installation/conda.html > ).? > > I keep getting the following error when attempting to run the line > "pip install - > f?https://github.com/simnibs/simnibs/releases/latest?simnibs"? > > Looking in links: https://github.com/simnibs/simnibs/releases/latest > ERROR: Could not find a version that satisfies the requirement > simnibs (from versions: none) > ERROR: No matching distribution found for simnibs > > I have tried to instead run variations such as?"pip install - > f?https://github.com/simnibs/simnibs/releases/v4.0.0 simnibs", which > gives the same error, ?and "pip > install?https://github.com/simnibs/simnibs/releases/v4.0.0", which > gives the following?error? > > Collecting https://github.com/simnibs/simnibs/releases/v4.0.0 > ??Downloading https://github.com/simnibs/simnibs/releases/v4.0.0 > ?? ??|?112.6 kB?853.2 kB/s?0:00:00 > ??ERROR: Cannot unpack file /tmp/pip-unpack-_5sf34ih/v4.0.0 > (downloaded from /tmp/pip-req-build-d2li2ds3, content-type: > text/html; charset=utf-8); cannot detect archive format > ERROR: Cannot determine archive format of /tmp/pip-req-build-d2li2ds3 > > I have tried doing the install on both mac and linux operating > systems and the same error comes up. I installed an earlier version > of simnibs (I believe v.3.2.6) less than 6 months ago using this same > method and encountered no problems. I attempted to see if installing > an earlier version would work?(ie using?"pip install - > f?https://github.com/simnibs/simnibs/releases/v3.2.6 simnibs") but > the same errors come up - ie this is not isolated to the latest > version. > > Please let me know if there is something I am missing in this > process? Thank you so much for your time and help.? > > Best, > > Elizabeth > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From oulap at drcmr.dk Tue Jan 17 19:54:20 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Tue, 17 Jan 2023 19:54:20 +0100 Subject: [Simnibs-discuss] tDCS electrode is being simulated as skin In-Reply-To: <666F1DDE-D746-4142-ACC0-D150B882A045@campus.lmu.de> References: <666F1DDE-D746-4142-ACC0-D150B882A045@campus.lmu.de> Message-ID: <1ebf4ed58ebf47d19af8e957314cbe616114c495.camel@drcmr.dk> Hi G?lce, I would consider this a segmentation error. You might want to try the new segmentation method (charm) included in simnibs version 4. In my experience it does a bit better job on ignoring the electrodes in the type of MRI data you have. The other option is that you edit the skin masks, which are inside the MASK_prep folder, manually and then re-run the surface and volume masking steps. The manual editing process was made easier in the new version, see here: https://simnibs.github.io/simnibs/build/html/tutorial/advanced/fix_headmodel.html so you might want to consider using SimNIBS4 in any case. Best, Oula On Tue, 2023-01-17 at 15:50 +0100, G?lce Lale wrote: > Dear SimNIBS Team, > We conduct post-hoc modelling for each subject using T1 and T2 images > acquired while the participant was in the scanner with the tDCS > electrodes attached. Here SimNIBS headreco images the 2mm layer of > electrode paste and includes in in the head mesh but segments it as > skin (see attached images). > According to SimNIBS skin conductance is 0.465 s/m and the electrode > material conductivity is 29.4 s/m. One would expect the Ten20 > Electrode paste which is applied with a 2mm thickness between the > electrode and skin to have a different measure. However, since it is > being considered and modelled as skin this could results in > deviations in the electric field modelling. > How do we account/solve this? > Could we model the electrodes 2mm below the head surface, knowing > that the outer 2mm thickness of the skin are actually due to the > paste? Thus, modelling the electrodes on the ?actual? skin outer > layer (and not on top of the paste). SimNIBS then allows us to > specify past + electrode thickness. Where we assume SimNIBS > calculates a different conductivity measure for both. > Is there an alternative solution to best account for the change of > conductance? > Thank you for your help in advance. > Best wishes, > G?lce? > > G?lce Lale > MSc Neurosciences > > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From shiima at kuhp.kyoto-u.ac.jp Wed Jan 18 01:36:28 2023 From: shiima at kuhp.kyoto-u.ac.jp (Atsushi Shima) Date: Wed, 18 Jan 2023 09:36:28 +0900 Subject: [Simnibs-discuss] Brainstem visualization In-Reply-To: References: <0d5cedf2e25d0dc801e8135d7684aab966f68594.camel@drcmr.dk> Message-ID: Dear Oula, Thank you. I could visualize the brainstem. I really appreciate your help. Best, Atsushi 2023?1?17?(?) 22:37 Oula Puonti : > Hi Atsushi, > > In gmsh if you select Tools -> Visibility, and then select WM in the > tissues list (along with GM if you like) you should be able to see the > brain stem. > > Best, > Oula > > > On Tue, 2023-01-17 at 13:15 +0900, Atsushi Shima wrote: > > Dear Oula, > > > > Thank you for your reply. > > I wanted to display the results of the simulation on the brainstem, > > instead of creating labels for the brainstem. > > Similarly in Ernie, the brainstem was not displayed in the results. > > Do I need to process to display of the white matter in gmsh? > > I appreciate your help. > > > > Best, > > Atsushi > > BS.pngBS2.png > > > > 2023?1?17?(?) 7:59 Oula Puonti : > > > Hi Atsushi, > > > > > > Are you trying to create a separate label for the brain stem? It > > > should > > > be part of the white matter in the standard charm output. > > > > > > You said that you can see the brain stem on ernie, so I'm wondering > > > if > > > something went wrong when you ran the specific subject where you > > > cannot > > > see the brain stem. > > > > > > Could you maybe send us a screenshot showing the problem? > > > > > > Thanks, > > > Oula > > > > > > > > > On Sun, 2023-01-15 at 21:20 +0900, Atsushi Shima wrote: > > > > Dear SimNIBS Team, > > > > > > > > Thank you for the wonderful program. I have a couple of > > > > questions. > > > > > > > > I would like to visualize the brainstem. > > > > The pipeline of "charm" seems working well. However, when we see > > > > the > > > > results with gmsh, there is a lack of the brainstem. > > > > I also tried the test data (ernie m2m), however, I could see the > > > > brainstem. > > > > > > > > Is it possible to visualize the brainstem in SimNIBS version > > > > 4.0.0? > > > > (I could see the previous papers describing the brainstem by v2 > > > > or > > > > 3.) > > > > I appreciate your help. > > > > > > > > Sincerely, > > > > Atsushi Shima > > > > _______________________________________________ > > > > Simnibs-discuss mailing list > > > > Simnibs-discuss at drcmr.dk > > > > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From danmccalley at stanford.edu Tue Jan 17 21:41:53 2023 From: danmccalley at stanford.edu (Daniel McCalley) Date: Tue, 17 Jan 2023 20:41:53 +0000 Subject: [Simnibs-discuss] Recurring poor GM segementation/surface with charm pipeline Message-ID: Hi all, I've noticed that in many (almost all) of the scans I've put through the charm pipeline have returned really nice surface segmentations of the scalp, bone, WM, etc. However, the grey matter surface typically appears very poor (loses detail in sulci/gyri). I've tried headreco and charm for 3 separate anatomical scan acquisitions and got the same result consistently (photo attached). I suspect something in the despiking/cleaning tetrahedra step in charm may be causing this, but I'm not sure. Any pointers or things to try for troubleshooting? Best, Dan McCalley, Ph.D. Postdoctoral Scholar, Padula BRAVE lab Stanford University School of Medicine, Psychiatry and Behavioral Sciences (he/him) -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot 2023-01-17 at 12.41.40 PM.png Type: image/png Size: 3248479 bytes Desc: Screenshot 2023-01-17 at 12.41.40 PM.png URL: From sean at rogue-research.com Tue Jan 17 22:21:49 2023 From: sean at rogue-research.com (Sean McBride) Date: Tue, 17 Jan 2023 16:21:49 -0500 Subject: [Simnibs-discuss] "The qform and sform of do not match..." why this requirement? In-Reply-To: References: <131224E8-4F2C-48F2-9D00-08E8A23E2663@rogue-research.com> <7e4e2a15e260e1bd65c4ef57888abb001df946e5.camel@drcmr.dk> <39B9F362-3F58-4A4B-9DEF-4D5471786338@rogue-research.com> Message-ID: <1F80D9D1-B23F-426D-B39F-FAB721BF0BF9@rogue-research.com> Oula, I created a ticket so you won't forget: https://github.com/simnibs/simnibs/issues/110 Cheers, Sean On 13 Jan 2023, at 16:01, Oula Puonti wrote: > Hi Sean, > > Makes sense, we'll add an option to use the sform. > > I guess for now you'll have to copy the sform to the qform before > calling simnibs. > > -Oula > > On Fri, 2023-01-13 at 15:38 -0500, Sean McBride wrote: >> NIFTI_XFORM_UNKNOWN From shiima at kuhp.kyoto-u.ac.jp Wed Jan 18 09:59:55 2023 From: shiima at kuhp.kyoto-u.ac.jp (Atsushi Shima) Date: Wed, 18 Jan 2023 17:59:55 +0900 Subject: [Simnibs-discuss] Percentage of spreading scalp stimulation Message-ID: Dear SimNIBS team, I have a question of the spreading stimulation on the scalp. Is it possible to know the relative percentage of the spreading scalp stimulation? Thanks, Atsushi Shima -------------- next part -------------- An HTML attachment was scrubbed... URL: From oulap at drcmr.dk Wed Jan 18 15:44:03 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Wed, 18 Jan 2023 15:44:03 +0100 Subject: [Simnibs-discuss] Recurring poor GM segementation/surface with charm pipeline In-Reply-To: References: Message-ID: <9361855a5bcf6c1f32297cf2643b6b25c3df7d55.camel@drcmr.dk> Hi Dan, Looking at the attached screenshot I would not expect a GM surface like that from charm, so I'm guessing something went wrong with the segmentation here. If the data set is openly available I can process a few of the problematic subjects and see if I can tweak some of the settings to make this work better. Best, Oula On Tue, 2023-01-17 at 20:41 +0000, Daniel McCalley wrote: > Hi all,? > > I've noticed that in many (almost all) of the scans I've put through > the charm pipeline have returned really nice surface segmentations of > the scalp, bone, WM, etc. However, the grey matter surface typically > appears very poor (loses detail in sulci/gyri). > > I've tried headreco and charm for 3 separate anatomical scan > acquisitions and got the same result consistently (photo attached).? > > I suspect something in the despiking/cleaning tetrahedra step in > charm may be causing this, but I'm not sure. Any pointers or things > to try for troubleshooting?? > > Best, > > Dan McCalley, Ph.D. > Postdoctoral Scholar, Padula BRAVE lab > Stanford University > School of Medicine, Psychiatry and Behavioral Sciences? > (he/him) > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From jesperdn at drcmr.dk Thu Jan 19 15:06:56 2023 From: jesperdn at drcmr.dk (Jesper Duemose Nielsen) Date: Thu, 19 Jan 2023 15:06:56 +0100 Subject: [Simnibs-discuss] Install using Conda not working In-Reply-To: <4e217b9466c347aeba9f5a7c39473e06@ubc.ca> References: <4e217b9466c347aeba9f5a7c39473e06@ubc.ca> Message-ID: <80bd4338-1233-6b41-3ce5-e2486c995d8d@drcmr.dk> Hi Elizabeth I am not exactly sure why the link doesn't work, however, you can pass the full address to the wheel, e.g., pip install https://github.com/simnibs/simnibs/releases/download/v4.0.0/simnibs-4.0.0-cp39-cp39-macosx_10_11_x86_64.whl (here for OSX). Note that this doesn't use the -f flag. Best, Jesper On 1/17/2023 5:29, Gregory, Elizabeth wrote: > > Hi there, > > > I am currently attempting to install the latest simnibs using a Conda > environment as outlined in the documentation > (https://simnibs.github.io/simnibs/build/html/installation/conda.html > ). > > > I keep getting the following error when attempting to run the line > "pip install -f https://github.com/simnibs/simnibs/releases/latest > ?simnibs" > > > Looking in links: https://github.com/simnibs/simnibs/releases/latest > > ERROR: Could not find a version that satisfies the requirement simnibs > (from versions: none) > > ERROR: No matching distribution found for simnibs > > > I have tried to instead run variations such as "pip install -f > https://github.com/simnibs/simnibs/releases/ > v4.0.0 simnibs", > which gives the same error, and "pip install > https://github.com/simnibs/simnibs/releases/ > v4.0.0", which > gives the following?error > > Collecting https://github.com/simnibs/simnibs/releases/v4.0.0 > > ??Downloading https://github.com/simnibs/simnibs/releases/v4.0.0 > > |112.6 kB853.2 kB/s0:00:00 > > ??ERROR: Cannot unpack file /tmp/pip-unpack-_5sf34ih/v4.0.0 > (downloaded from /tmp/pip-req-build-d2li2ds3, content-type: text/html; > charset=utf-8); cannot detect archive format > > ERROR: Cannot determine archive format of /tmp/pip-req-build-d2li2ds3 > > > I have tried doing the install on both mac and linux operating systems > and the same error comes up. I installed an earlier version of simnibs > (I believe v.3.2.6) less than 6 months ago using this same method and > encountered no problems. I attempted to see if installing an earlier > version would work?(ie using "pip install -f > https://github.com/simnibs/simnibs/releases/ > v3.2.6 simnibs") > but the same errors come up - ie this is not isolated to the latest > version. > > > Please let me know if there is something I am missing in this process? > Thank you so much for your time and help. > > > Best, > > > Elizabeth > > > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss -------------- next part -------------- An HTML attachment was scrubbed... URL: From G.Lale at campus.lmu.de Fri Jan 20 17:25:04 2023 From: G.Lale at campus.lmu.de (=?utf-8?Q?G=C3=BClce_Lale?=) Date: Fri, 20 Jan 2023 17:25:04 +0100 Subject: [Simnibs-discuss] tDCS electrode is being simulated as skin In-Reply-To: <1ebf4ed58ebf47d19af8e957314cbe616114c495.camel@drcmr.dk> References: <666F1DDE-D746-4142-ACC0-D150B882A045@campus.lmu.de> <1ebf4ed58ebf47d19af8e957314cbe616114c495.camel@drcmr.dk> Message-ID: <6C876086-9FFC-4CA4-80F0-475196596911@campus.lmu.de> Hi Oula, Thank you very much for your response, I will try it with charm and SimNIBS4. I would like to clarify something and ask for your opinion. What tissue the electrodes should be segmented as? Should they be left out of the segmentation? Or be segmented as one of the other 15 tissues? Thank you for your help in advance. Best wishes, G?lce > On 17 Jan 2023, at 19:54, Oula Puonti wrote: > > Hi G?lce, > > I would consider this a segmentation error. You might want to try the > new segmentation method (charm) included in simnibs version 4. In my > experience it does a bit better job on ignoring the electrodes in the > type of MRI data you have. > > The other option is that you edit the skin masks, which are inside the > MASK_prep folder, manually and then re-run the surface and volume > masking steps. > > The manual editing process was made easier in the new version, see > here: > > https://simnibs.github.io/simnibs/build/html/tutorial/advanced/fix_headmodel.html > > so you might want to consider using SimNIBS4 in any case. > > Best, > Oula > > > On Tue, 2023-01-17 at 15:50 +0100, G?lce Lale wrote: >> Dear SimNIBS Team, >> We conduct post-hoc modelling for each subject using T1 and T2 images >> acquired while the participant was in the scanner with the tDCS >> electrodes attached. Here SimNIBS headreco images the 2mm layer of >> electrode paste and includes in in the head mesh but segments it as >> skin (see attached images). >> According to SimNIBS skin conductance is 0.465 s/m and the electrode >> material conductivity is 29.4 s/m. One would expect the Ten20 >> Electrode paste which is applied with a 2mm thickness between the >> electrode and skin to have a different measure. However, since it is >> being considered and modelled as skin this could results in >> deviations in the electric field modelling. >> How do we account/solve this? >> Could we model the electrodes 2mm below the head surface, knowing >> that the outer 2mm thickness of the skin are actually due to the >> paste? Thus, modelling the electrodes on the ?actual? skin outer >> layer (and not on top of the paste). SimNIBS then allows us to >> specify past + electrode thickness. Where we assume SimNIBS >> calculates a different conductivity measure for both. >> Is there an alternative solution to best account for the change of >> conductance? >> Thank you for your help in advance. >> Best wishes, >> G?lce >> >> G?lce Lale >> MSc Neurosciences >> >> _______________________________________________ >> Simnibs-discuss mailing list >> Simnibs-discuss at drcmr.dk >> https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss -------------- next part -------------- An HTML attachment was scrubbed... URL: From oulap at drcmr.dk Fri Jan 20 19:11:35 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Fri, 20 Jan 2023 19:11:35 +0100 Subject: [Simnibs-discuss] tDCS electrode is being simulated as skin In-Reply-To: <6C876086-9FFC-4CA4-80F0-475196596911@campus.lmu.de> References: <666F1DDE-D746-4142-ACC0-D150B882A045@campus.lmu.de> <1ebf4ed58ebf47d19af8e957314cbe616114c495.camel@drcmr.dk> <6C876086-9FFC-4CA4-80F0-475196596911@campus.lmu.de> Message-ID: <44a3bfcaeb987ae47b718ae882771cf56fc3e354.camel@drcmr.dk> Hi G?lce, You should leave them out, i.e., label them as background. SimNIBS places the electrodes automatically during the simulation, so you don't need to add them to the headmodel yourself. You can record the center coordinate of the electrodes from the MRI scans and pass that to the simulation so that the electrodes are placed correctly. Best, Oula On Fri, 2023-01-20 at 17:25 +0100, G?lce Lale wrote: > Hi Oula, > > Thank you very much for your response, I will try it with charm and > SimNIBS4. > I would like to clarify something and ask for your opinion.?What > tissue the electrodes should be segmented as? Should they be left out > of the segmentation? Or be segmented as one of the other 15 tissues? > > Thank you for your help in advance. > Best wishes, > G?lce > > > On 17 Jan 2023, at 19:54, Oula Puonti wrote: > > > > Hi G?lce, > > > > I would consider this a segmentation error. You might want to try > > the > > new segmentation method (charm) included in simnibs version 4. In > > my > > experience it does a bit better job on ignoring the electrodes in > > the > > type of MRI data you have. > > > > The other option is that you edit the skin masks, which are inside > > the > > MASK_prep folder, manually and then re-run the surface and volume > > masking steps. > > > > The manual editing process was made easier in the new version, see > > here:? > > > > https://simnibs.github.io/simnibs/build/html/tutorial/advanced/fix_headmodel.html > > > > so you might want to consider using SimNIBS4 in any case. > > > > Best, > > Oula > > > > > > On Tue, 2023-01-17 at 15:50 +0100, G?lce Lale wrote: > > > Dear SimNIBS Team, > > > We conduct post-hoc modelling for each subject using T1 and T2 > > > images > > > acquired while the participant was in the scanner with the tDCS > > > electrodes attached. Here SimNIBS headreco images the 2mm layer > > > of > > > electrode paste and includes in in the head mesh but segments it > > > as > > > skin (see attached images). > > > According to SimNIBS skin conductance is 0.465 s/m and the > > > electrode > > > material conductivity is 29.4 s/m. One would expect the Ten20 > > > Electrode paste which is applied with a 2mm thickness between the > > > electrode and skin to have a different measure. However, since it > > > is > > > being considered and modelled as skin this could results in > > > deviations in the electric field modelling. > > > How do we account/solve this? > > > Could we model the electrodes 2mm below the head surface, knowing > > > that the outer 2mm thickness of the skin are actually due to the > > > paste? Thus, modelling the electrodes on the ?actual? skin outer > > > layer (and not on top of the paste). SimNIBS then allows us to > > > specify past + electrode thickness. Where we assume SimNIBS > > > calculates a different conductivity measure for both. > > > Is there an alternative solution to best account for the change > > > of > > > conductance? > > > Thank you for your help in advance. > > > Best wishes, > > > G?lce? > > > > > > G?lce Lale > > > MSc Neurosciences > > > > > > _______________________________________________ > > > Simnibs-discuss mailing list > > > Simnibs-discuss at drcmr.dk > > > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss > From peymanbiom at gmail.com Sun Jan 22 13:08:01 2023 From: peymanbiom at gmail.com (Peyman Ghobadi) Date: Sun, 22 Jan 2023 15:38:01 +0330 Subject: [Simnibs-discuss] Scripting simulation with Matlab - SimNIBS 4 Message-ID: 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 from simnibs import run_simnibs File "/home/incas/SimNIBS-4.0/simnibs_env/lib/python3.9/site-packages/simnibs/__init__.py", line 21, in 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 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 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 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: From hassanyazdanian at gmail.com Sun Jan 22 19:12:54 2023 From: hassanyazdanian at gmail.com (Hassan Yazdanian) Date: Sun, 22 Jan 2023 21:42:54 +0330 Subject: [Simnibs-discuss] SimNIBS 4.0 on Ubuntu 22 Message-ID: Hi, I am trying to install SimNIBS 4.0 on Ubuntu 22. After installation is completed, I close the terminal and open a new terminal. In the new terminal, I type simnibs_gui but unfortunately I only see a black screen. The error in terminal is composeAndFlush: makeCurrent() failed. I would be grateful for any possible solution. Best wishes, -Hassan -- Hassan Yazdanian, PhD. Department of Biomedical Engineering Faculty of Electrical Engineering K.N.Toosi University of Technology -------------- next part -------------- An HTML attachment was scrubbed... URL: From kristofferm at drcmr.dk Mon Jan 23 09:45:13 2023 From: kristofferm at drcmr.dk (Kristoffer Madsen) Date: Mon, 23 Jan 2023 09:45:13 +0100 Subject: [Simnibs-discuss] SimNIBS 4.0 on Ubuntu 22 In-Reply-To: References: Message-ID: This is normally because pyQt has problems with binaries on the Wayland backend. As mentioned in changelog for 4.0, you should try preloading your system libstdc++.so.6 (from a terminal, prior to running simnibs_gui): simnibs_gui does not start on some linux systems, e.g. with wayland (workaround: ld preloading of libstdc++.so.6 seems to help; example: export LD_PRELOAD=/usr/lib/libstdc++.so.6 - path needs to be adjusted according to library path on local system) I would be nice if you could confirm if this works or not. Best, Kristoffer On Mon, 23 Jan 2023 at 09:20, Hassan Yazdanian wrote: > > Hi, > > I am trying to install SimNIBS 4.0 on Ubuntu 22. After installation is completed, I close the terminal and open a new terminal. In the new terminal, I type simnibs_gui but unfortunately I only see a black screen. The error in terminal is > > composeAndFlush: makeCurrent() failed. > > > I would be grateful for any possible solution. > > > Best wishes, > > -Hassan > > > > > > -- > Hassan Yazdanian, PhD. > Department of Biomedical Engineering > Faculty of Electrical Engineering > K.N.Toosi University of Technology > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From oulap at drcmr.dk Mon Jan 23 15:00:43 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Mon, 23 Jan 2023 15:00:43 +0100 Subject: [Simnibs-discuss] Scripting simulation with Matlab - SimNIBS 4 In-Reply-To: References: Message-ID: Hi Peyman, If the GUI works and matlab does not, it might have something to do with the issue here: https://github.com/simnibs/simnibs/issues/106 namely that the system call in matlab does not see the correct libraries for some reason. You can try to run a linker on the create_mesh .so and see which libraries it needs and then try to preload those. I don't have a good solution to this issue at the moment. Could you also try if the script works if you run it in python? I'm guessing it will, as you said that the GUI works. Best, Oula On Sun, 2023-01-22 at 15:38 +0330, Peyman Ghobadi wrote: > 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 information > > S = sim_struct('SESSION'); > S.subpath = 'm2m_sub01'; % subject folder > S.pathfem = 'tdcs_simu'; % Folder for the simulation output > S.map_to_surf = true; ? > > %% Define tDCS simulation > S.poslist{1} = sim_struct('TDCSLIST'); > S.poslist{1}.currents = [0.002, -0.002]; % Current flow though each > channel (A) > > %First Electrode > S.poslist{1}.electrode(1).channelnr = 1; % Connect the electrode to > the first channel > S.poslist{1}.electrode(1).centre = 'F4'; % Place it over F4 > S.poslist{1}.electrode(1).shape = 'rect'; %Rectangular electrode > S.poslist{1}.electrode(1).dimensions = [50, 70]; % Dimension in mm > S.poslist{1}.electrode(1).thickness = 4; % 4 mm thickness > > %Second Electrode > S.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 Simulation > run_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 > ? ? from simnibs import run_simnibs > ? File "/home/incas/SimNIBS-4.0/simnibs_env/lib/python3.9/site- > packages/simnibs/__init__.py", line 21, in > ? ? 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 > ? ? 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 > ? ? 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 > ? ? 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 > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From hassanyazdanian at gmail.com Tue Jan 24 06:21:55 2023 From: hassanyazdanian at gmail.com (Hassan Yazdanian) Date: Tue, 24 Jan 2023 08:51:55 +0330 Subject: [Simnibs-discuss] SimNIBS 4.0 on Ubuntu 22 In-Reply-To: References: Message-ID: Dear Kristoffer, Thank you for the solution. It works. I think I should run the gui by the following command every time: LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 simnibs_gui Best wishes, -Hassan On Mon, Jan 23, 2023 at 12:15 PM Kristoffer Madsen wrote: > This is normally because pyQt has problems with binaries on the > Wayland backend. As mentioned in changelog for 4.0, you should try > preloading your system libstdc++.so.6 (from a terminal, prior to > running simnibs_gui): > > simnibs_gui does not start on some linux systems, e.g. with wayland > (workaround: ld preloading of libstdc++.so.6 seems to help; example: > export LD_PRELOAD=/usr/lib/libstdc++.so.6 - path needs to be adjusted > according to library path on local system) > > I would be nice if you could confirm if this works or not. > > Best, > Kristoffer > > On Mon, 23 Jan 2023 at 09:20, Hassan Yazdanian > wrote: > > > > Hi, > > > > I am trying to install SimNIBS 4.0 on Ubuntu 22. After installation is > completed, I close the terminal and open a new terminal. In the new > terminal, I type simnibs_gui but unfortunately I only see a black screen. > The error in terminal is > > > > composeAndFlush: makeCurrent() failed. > > > > > > I would be grateful for any possible solution. > > > > > > Best wishes, > > > > -Hassan > > > > > > > > > > > > -- > > Hassan Yazdanian, PhD. > > Department of Biomedical Engineering > > Faculty of Electrical Engineering > > K.N.Toosi University of Technology > > _______________________________________________ > > Simnibs-discuss mailing list > > Simnibs-discuss at drcmr.dk > > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss > -- Hassan Yazdanian, PhD. Department of Biomedical Engineering Faculty of Electrical Engineering K.N.Toosi University of Technology -------------- next part -------------- An HTML attachment was scrubbed... URL: From danielle_sliva at brown.edu Tue Jan 24 17:26:49 2023 From: danielle_sliva at brown.edu (Sliva, Danielle) Date: Tue, 24 Jan 2023 11:26:49 -0500 Subject: [Simnibs-discuss] Importing Brainsight Targets to SimNIBS - Target Seems Off Message-ID: Hello, I am using SimNIBS4 to do a TMS simulation with targets from a previous experimental session that utilized Brainsight for neuronavigation. I followed the instructions here < https://simnibs.github.io/simnibs/build/html/documentation/neuronavigation/brainsight.html?highlight=brainsight> to import the targets from a Brainsight output text file, and chose the *World* coordinate system (*NIfTI:aligned* was not an available option). The target I'm using is in primary somatosensory cortex, adjacent to the motor hand knob. When I look at the simulation results in gmesh, it looks like the coil position is off - it is in the correct general area, but way too deep in the brain. The spatial distribution of the electrical field is also too deep in the brain, without activation on the surface of the gyri. I found the same issue for a different control target location. I used raw files (DICOM converted to NIfTI & DICOM) for SimNIBS and Brainsight, respectively. I know that Brainsight does some preprocessing to the image (e.g. alignment to AC-PC line) - is this accounted for in the automatic LPS to RAS conversion in simnibs.brainsight.read()? Is there another co-registration step that I am missing? Any advice is much appreciated. Many thanks, Danielle -- Danielle D. Sliva PhD Candidate, Jones Lab Dept. of Neuroscience Brown University -------------- next part -------------- An HTML attachment was scrubbed... URL: From Ville.Rimpilainen at liverpool.ac.uk Tue Jan 24 20:10:26 2023 From: Ville.Rimpilainen at liverpool.ac.uk (Rimpilainen, Ville) Date: Tue, 24 Jan 2023 19:10:26 +0000 Subject: [Simnibs-discuss] Headreco vs Charm Message-ID: Dear SimNIBS Team, In headreco it was possible to influence the density of nodes in the mesh by using the attribute -v. Now, I did not find similar feature in charm. Could you please advice whether charm has this feature, and if it has, then how to use it. Thank you! Best wishes, Ville Dr. Ville Rimpilainen Lecturer - Academic Manager University of Liverpool -------------- next part -------------- An HTML attachment was scrubbed... URL: From oulap at drcmr.dk Tue Jan 24 20:31:18 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Tue, 24 Jan 2023 20:31:18 +0100 Subject: [Simnibs-discuss] Headreco vs Charm In-Reply-To: References: Message-ID: Hi Ville, You can copy the settings.ini file from inside the m2m-folder and edit the following field: # Define thickness-dependent element sizes # "range": upper and lower cut-offs for element sizes # "slope": the smaller the finer the mesh # "standard": applies to all tissues not defined otherwise elem_sizes = {"standard": {"range": [1, 5], "slope": 1.0}, "1": {"range": [1, 7], "slope": 1.0}, "2": {"range": [1, 2], "slope": 1.0}, "5": {"range": [1, 5], "slope": 0.6}} where the element sizes are in mm. If you want smaller elements you can either change the lower and upper bounds or the slope or both. The mesh resolution will still be spatially adaptive depending on the thicknesses of the various tissues, which are calculated automatically in charm. Once you've modified the settings.ini file you can do a new charm run with the additional flag "--usesetting settings.ini", or, if you already have a charm run, you can remesh the upsampled tissue labeling using the meshmesh function, see here: https://simnibs.github.io/simnibs/build/html/documentation/command_line/meshmesh.html?highlight=meshmesh If you want fine-level spatial control of the density, the meshmesh function also accepts a sizing field as an input. In a standard charm run the sizing field is based on the automatically calculated tissue thicknesses. Best, Oula On Tue, 2023-01-24 at 19:10 +0000, Rimpilainen, Ville wrote: > Dear SimNIBS Team, > > In headreco it was possible to influence the density of nodes in the > mesh by using the attribute -v. Now, I did not find similar feature > in charm. Could you please advice whether charm has this feature, and > if it has, then how to use it. Thank you! > > Best wishes, > Ville > > Dr. Ville Rimpilainen > Lecturer - Academic Manager > University of Liverpool > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From G.Lale at campus.lmu.de Wed Jan 25 14:15:13 2023 From: G.Lale at campus.lmu.de (=?utf-8?Q?G=C3=BClce_Lale?=) Date: Wed, 25 Jan 2023 14:15:13 +0100 Subject: [Simnibs-discuss] tDCS electrode is being simulated as skin In-Reply-To: <44a3bfcaeb987ae47b718ae882771cf56fc3e354.camel@drcmr.dk> References: <666F1DDE-D746-4142-ACC0-D150B882A045@campus.lmu.de> <1ebf4ed58ebf47d19af8e957314cbe616114c495.camel@drcmr.dk> <6C876086-9FFC-4CA4-80F0-475196596911@campus.lmu.de> <44a3bfcaeb987ae47b718ae882771cf56fc3e354.camel@drcmr.dk> Message-ID: Dear Oula, Thank you for the help. We were able to label electrode gel as background in the segmentation. However, when deriving our electrode center coordinates, we still define the top of the electrode gel. We know that we apply 2mm of electrode gel on top of the electrodes. Thus, the coordinates acquired from the MRI image should be 2mm below, so that they are at the actual skull height. How do we convert length measures such as 2mm into world coordinates which SimNIBS uses? And, can I find information on this on the website? Thank you for your time. Best wishes, G?lce > On 20 Jan 2023, at 19:11, Oula Puonti wrote: > > Hi G?lce, > > You should leave them out, i.e., label them as background. SimNIBS > places the electrodes automatically during the simulation, so you don't > need to add them to the headmodel yourself. > > You can record the center coordinate of the electrodes from the MRI > scans and pass that to the simulation so that the electrodes are placed > correctly. > > Best, > Oula > > > On Fri, 2023-01-20 at 17:25 +0100, G?lce Lale wrote: >> Hi Oula, >> >> Thank you very much for your response, I will try it with charm and >> SimNIBS4. >> I would like to clarify something and ask for your opinion. What >> tissue the electrodes should be segmented as? Should they be left out >> of the segmentation? Or be segmented as one of the other 15 tissues? >> >> Thank you for your help in advance. >> Best wishes, >> G?lce >> >>> On 17 Jan 2023, at 19:54, Oula Puonti wrote: >>> >>> Hi G?lce, >>> >>> I would consider this a segmentation error. You might want to try >>> the >>> new segmentation method (charm) included in simnibs version 4. In >>> my >>> experience it does a bit better job on ignoring the electrodes in >>> the >>> type of MRI data you have. >>> >>> The other option is that you edit the skin masks, which are inside >>> the >>> MASK_prep folder, manually and then re-run the surface and volume >>> masking steps. >>> >>> The manual editing process was made easier in the new version, see >>> here: >>> >>> https://simnibs.github.io/simnibs/build/html/tutorial/advanced/fix_headmodel.html >>> >>> so you might want to consider using SimNIBS4 in any case. >>> >>> Best, >>> Oula >>> >>> >>> On Tue, 2023-01-17 at 15:50 +0100, G?lce Lale wrote: >>>> Dear SimNIBS Team, >>>> We conduct post-hoc modelling for each subject using T1 and T2 >>>> images >>>> acquired while the participant was in the scanner with the tDCS >>>> electrodes attached. Here SimNIBS headreco images the 2mm layer >>>> of >>>> electrode paste and includes in in the head mesh but segments it >>>> as >>>> skin (see attached images). >>>> According to SimNIBS skin conductance is 0.465 s/m and the >>>> electrode >>>> material conductivity is 29.4 s/m. One would expect the Ten20 >>>> Electrode paste which is applied with a 2mm thickness between the >>>> electrode and skin to have a different measure. However, since it >>>> is >>>> being considered and modelled as skin this could results in >>>> deviations in the electric field modelling. >>>> How do we account/solve this? >>>> Could we model the electrodes 2mm below the head surface, knowing >>>> that the outer 2mm thickness of the skin are actually due to the >>>> paste? Thus, modelling the electrodes on the ?actual? skin outer >>>> layer (and not on top of the paste). SimNIBS then allows us to >>>> specify past + electrode thickness. Where we assume SimNIBS >>>> calculates a different conductivity measure for both. >>>> Is there an alternative solution to best account for the change >>>> of >>>> conductance? >>>> Thank you for your help in advance. >>>> Best wishes, >>>> G?lce >>>> >>>> G?lce Lale >>>> MSc Neurosciences >>>> >>>> _______________________________________________ >>>> Simnibs-discuss mailing list >>>> Simnibs-discuss at drcmr.dk >>>> https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From oulap at drcmr.dk Fri Jan 27 14:55:18 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Fri, 27 Jan 2023 14:55:18 +0100 Subject: [Simnibs-discuss] tDCS electrode is being simulated as skin In-Reply-To: References: <666F1DDE-D746-4142-ACC0-D150B882A045@campus.lmu.de> <1ebf4ed58ebf47d19af8e957314cbe616114c495.camel@drcmr.dk> <6C876086-9FFC-4CA4-80F0-475196596911@campus.lmu.de> <44a3bfcaeb987ae47b718ae882771cf56fc3e354.camel@drcmr.dk> Message-ID: <672c1bfe310d82cb23f623124c6210cb29e72e6f.camel@drcmr.dk> Hi G?lce, You can just take the center coordinate (x,y,z) for the electrode from the MRI, put that in the GUI (or a script), and project the coordinate to the skin surface. This will keep the x and y coordinates (more or less) the same but set the z so that the position is on the skin. After that, when you define the electrode shape, just add a 2mm gel layer and that should be it. Best, Oula On Wed, 2023-01-25 at 14:15 +0100, G?lce Lale wrote: > Dear Oula, > Thank you for the help. We were able to label electrode gel as > background in the segmentation. However, when deriving our electrode > center coordinates, we still define the top of the electrode gel. We > know that we apply 2mm of electrode gel on top of the electrodes. > Thus, the coordinates acquired from the MRI image should be 2mm > below, so that they are at the actual skull height.? > How do we convert length measures such as 2mm into world coordinates > which SimNIBS uses? And, can I find information on this on the > website? > Thank you for your time. > Best wishes, > G?lce > > > On 20 Jan 2023, at 19:11, Oula Puonti wrote: > > > > Hi G?lce, > > > > You should leave them out, i.e., label them as background. SimNIBS > > places the electrodes automatically during the simulation, so you > > don't > > need to add them to the headmodel yourself. > > > > You can record the center coordinate of the electrodes from the MRI > > scans and pass that to the simulation so that the electrodes are > > placed > > correctly. > > > > Best, > > Oula > > > > > > On Fri, 2023-01-20 at 17:25 +0100, G?lce Lale wrote: > > > Hi Oula, > > > > > > Thank you very much for your response, I will try it with charm > > > and > > > SimNIBS4. > > > I would like to clarify something and ask for your opinion.?What > > > tissue the electrodes should be segmented as? Should they be left > > > out > > > of the segmentation? Or be segmented as one of the other 15 > > > tissues? > > > > > > Thank you for your help in advance. > > > Best wishes, > > > G?lce > > > > > > > On 17 Jan 2023, at 19:54, Oula Puonti wrote: > > > > > > > > Hi G?lce, > > > > > > > > I would consider this a segmentation error. You might want to > > > > try > > > > the > > > > new segmentation method (charm) included in simnibs version 4. > > > > In > > > > my > > > > experience it does a bit better job on ignoring the electrodes > > > > in > > > > the > > > > type of MRI data you have. > > > > > > > > The other option is that you edit the skin masks, which are > > > > inside > > > > the > > > > MASK_prep folder, manually and then re-run the surface and > > > > volume > > > > masking steps. > > > > > > > > The manual editing process was made easier in the new version, > > > > see > > > > here:? > > > > > > > > https://simnibs.github.io/simnibs/build/html/tutorial/advanced/fix_headmodel.html > > > > > > > > so you might want to consider using SimNIBS4 in any case. > > > > > > > > Best, > > > > Oula > > > > > > > > > > > > On Tue, 2023-01-17 at 15:50 +0100, G?lce Lale wrote: > > > > > Dear SimNIBS Team, > > > > > We conduct post-hoc modelling for each subject using T1 and > > > > > T2 > > > > > images > > > > > acquired while the participant was in the scanner with the > > > > > tDCS > > > > > electrodes attached. Here SimNIBS headreco images the 2mm > > > > > layer > > > > > of > > > > > electrode paste and includes in in the head mesh but segments > > > > > it > > > > > as > > > > > skin (see attached images). > > > > > According to SimNIBS skin conductance is 0.465 s/m and the > > > > > electrode > > > > > material conductivity is 29.4 s/m. One would expect the Ten20 > > > > > Electrode paste which is applied with a 2mm thickness between > > > > > the > > > > > electrode and skin to have a different measure. However, > > > > > since it > > > > > is > > > > > being considered and modelled as skin this could results in > > > > > deviations in the electric field modelling. > > > > > How do we account/solve this? > > > > > Could we model the electrodes 2mm below the head surface, > > > > > knowing > > > > > that the outer 2mm thickness of the skin are actually due to > > > > > the > > > > > paste? Thus, modelling the electrodes on the ?actual? skin > > > > > outer > > > > > layer (and not on top of the paste). SimNIBS then allows us > > > > > to > > > > > specify past + electrode thickness. Where we assume SimNIBS > > > > > calculates a different conductivity measure for both. > > > > > Is there an alternative solution to best account for the > > > > > change > > > > > of > > > > > conductance? > > > > > Thank you for your help in advance. > > > > > Best wishes, > > > > > G?lce? > > > > > > > > > > G?lce Lale > > > > > MSc Neurosciences > > > > > > > > > > _______________________________________________ > > > > > Simnibs-discuss mailing list > > > > > Simnibs-discuss at drcmr.dk > > > > > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss > > > > > > From hassanyazdanian at gmail.com Sat Jan 28 19:25:49 2023 From: hassanyazdanian at gmail.com (Hassan Yazdanian) Date: Sat, 28 Jan 2023 21:55:49 +0330 Subject: [Simnibs-discuss] Using Spyder Message-ID: Hi, I install Spyder IDE editor to run scripts. But, I am getting the following error message when I want to start Spyder: ( Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb. Aborted (core dumped) ) Any possible help would be appreciated. Best wishes, -Hassan -- Hassan Yazdanian, PhD. Department of Biomedical Engineering Faculty of Electrical Engineering K.N.Toosi University of Technology -------------- next part -------------- An HTML attachment was scrubbed... URL: From marycollegew09k at gmail.com Sun Jan 29 15:21:15 2023 From: marycollegew09k at gmail.com (Marya Alhaj) Date: Sun, 29 Jan 2023 17:21:15 +0300 Subject: [Simnibs-discuss] SIMNIBS Message-ID: Dear sir/madam: I am a 4th year biomedical engineering student, I have a research project on SIMNIBS so I wonder if I have to download Freesurfer to view volume space results and do the segmentation in the SIMNIBS current edition ? Yours sincerely, Marya Alothman. -------------- next part -------------- An HTML attachment was scrubbed... URL: From G.Lale at campus.lmu.de Mon Jan 30 12:11:45 2023 From: G.Lale at campus.lmu.de (=?utf-8?Q?G=C3=BClce_Lale?=) Date: Mon, 30 Jan 2023 12:11:45 +0100 Subject: [Simnibs-discuss] tDCS electrode is being simulated as skin In-Reply-To: <672c1bfe310d82cb23f623124c6210cb29e72e6f.camel@drcmr.dk> References: <666F1DDE-D746-4142-ACC0-D150B882A045@campus.lmu.de> <1ebf4ed58ebf47d19af8e957314cbe616114c495.camel@drcmr.dk> <6C876086-9FFC-4CA4-80F0-475196596911@campus.lmu.de> <44a3bfcaeb987ae47b718ae882771cf56fc3e354.camel@drcmr.dk> <672c1bfe310d82cb23f623124c6210cb29e72e6f.camel@drcmr.dk> Message-ID: Hi Oula, I just wanted to clarify: the coordinate (x,y,z) defines the location of the electrode in the space, therefore, the z axis does not determine the distance of the electrode to the skin. As it states in the website the coordinates do not need to be exactly in the skin surface, as SimNIBS automatically finds the closest point in the skin surface. Therefore, whatever I give as the coordinates of the electrode, SimNIBS will place my electrodes on to the closest points to the skin surface. Otherwise, how can I state in the script or in the gui that I would like to position the electrodes on to the skin? There is a skin distance parameter for the TMS electrodes, however, I could not see that for tDCS electrodes. Thank you for your help in advance. Best wishes, G?lce > On 27 Jan 2023, at 14:55, Oula Puonti wrote: > > Hi G?lce, > > You can just take the center coordinate (x,y,z) for the electrode from > the MRI, put that in the GUI (or a script), and project the coordinate > to the skin surface. This will keep the x and y coordinates (more or > less) the same but set the z so that the position is on the skin. After > that, when you define the electrode shape, just add a 2mm gel layer and > that should be it. > > Best, > Oula > > > On Wed, 2023-01-25 at 14:15 +0100, G?lce Lale wrote: >> Dear Oula, >> Thank you for the help. We were able to label electrode gel as >> background in the segmentation. However, when deriving our electrode >> center coordinates, we still define the top of the electrode gel. We >> know that we apply 2mm of electrode gel on top of the electrodes. >> Thus, the coordinates acquired from the MRI image should be 2mm >> below, so that they are at the actual skull height. >> How do we convert length measures such as 2mm into world coordinates >> which SimNIBS uses? And, can I find information on this on the >> website? >> Thank you for your time. >> Best wishes, >> G?lce >> >>> On 20 Jan 2023, at 19:11, Oula Puonti wrote: >>> >>> Hi G?lce, >>> >>> You should leave them out, i.e., label them as background. SimNIBS >>> places the electrodes automatically during the simulation, so you >>> don't >>> need to add them to the headmodel yourself. >>> >>> You can record the center coordinate of the electrodes from the MRI >>> scans and pass that to the simulation so that the electrodes are >>> placed >>> correctly. >>> >>> Best, >>> Oula >>> >>> >>> On Fri, 2023-01-20 at 17:25 +0100, G?lce Lale wrote: >>>> Hi Oula, >>>> >>>> Thank you very much for your response, I will try it with charm >>>> and >>>> SimNIBS4. >>>> I would like to clarify something and ask for your opinion. What >>>> tissue the electrodes should be segmented as? Should they be left >>>> out >>>> of the segmentation? Or be segmented as one of the other 15 >>>> tissues? >>>> >>>> Thank you for your help in advance. >>>> Best wishes, >>>> G?lce >>>> >>>>> On 17 Jan 2023, at 19:54, Oula Puonti wrote: >>>>> >>>>> Hi G?lce, >>>>> >>>>> I would consider this a segmentation error. You might want to >>>>> try >>>>> the >>>>> new segmentation method (charm) included in simnibs version 4. >>>>> In >>>>> my >>>>> experience it does a bit better job on ignoring the electrodes >>>>> in >>>>> the >>>>> type of MRI data you have. >>>>> >>>>> The other option is that you edit the skin masks, which are >>>>> inside >>>>> the >>>>> MASK_prep folder, manually and then re-run the surface and >>>>> volume >>>>> masking steps. >>>>> >>>>> The manual editing process was made easier in the new version, >>>>> see >>>>> here: >>>>> >>>>> https://simnibs.github.io/simnibs/build/html/tutorial/advanced/fix_headmodel.html >>>>> >>>>> so you might want to consider using SimNIBS4 in any case. >>>>> >>>>> Best, >>>>> Oula >>>>> >>>>> >>>>> On Tue, 2023-01-17 at 15:50 +0100, G?lce Lale wrote: >>>>>> Dear SimNIBS Team, >>>>>> We conduct post-hoc modelling for each subject using T1 and >>>>>> T2 >>>>>> images >>>>>> acquired while the participant was in the scanner with the >>>>>> tDCS >>>>>> electrodes attached. Here SimNIBS headreco images the 2mm >>>>>> layer >>>>>> of >>>>>> electrode paste and includes in in the head mesh but segments >>>>>> it >>>>>> as >>>>>> skin (see attached images). >>>>>> According to SimNIBS skin conductance is 0.465 s/m and the >>>>>> electrode >>>>>> material conductivity is 29.4 s/m. One would expect the Ten20 >>>>>> Electrode paste which is applied with a 2mm thickness between >>>>>> the >>>>>> electrode and skin to have a different measure. However, >>>>>> since it >>>>>> is >>>>>> being considered and modelled as skin this could results in >>>>>> deviations in the electric field modelling. >>>>>> How do we account/solve this? >>>>>> Could we model the electrodes 2mm below the head surface, >>>>>> knowing >>>>>> that the outer 2mm thickness of the skin are actually due to >>>>>> the >>>>>> paste? Thus, modelling the electrodes on the ?actual? skin >>>>>> outer >>>>>> layer (and not on top of the paste). SimNIBS then allows us >>>>>> to >>>>>> specify past + electrode thickness. Where we assume SimNIBS >>>>>> calculates a different conductivity measure for both. >>>>>> Is there an alternative solution to best account for the >>>>>> change >>>>>> of >>>>>> conductance? >>>>>> Thank you for your help in advance. >>>>>> Best wishes, >>>>>> G?lce >>>>>> >>>>>> G?lce Lale >>>>>> MSc Neurosciences >>>>>> >>>>>> _______________________________________________ >>>>>> Simnibs-discuss mailing list >>>>>> Simnibs-discuss at drcmr.dk >>>>>> https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From oulap at drcmr.dk Mon Jan 30 17:54:36 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Mon, 30 Jan 2023 17:54:36 +0100 Subject: [Simnibs-discuss] tDCS electrode is being simulated as skin In-Reply-To: References: <666F1DDE-D746-4142-ACC0-D150B882A045@campus.lmu.de> <1ebf4ed58ebf47d19af8e957314cbe616114c495.camel@drcmr.dk> <6C876086-9FFC-4CA4-80F0-475196596911@campus.lmu.de> <44a3bfcaeb987ae47b718ae882771cf56fc3e354.camel@drcmr.dk> <672c1bfe310d82cb23f623124c6210cb29e72e6f.camel@drcmr.dk> Message-ID: Hi G?lce, Yes exactly, you only need the center coordinate for the electrode from the MRI scan so that the electrode is placed on the correct location in the simulations. Simnibs will automatically place the electrode on the skin in the simulation (by projecting it to the closest point as you said). The only thing you need to define additionally is the gel thickness (2mm) when you're setting the electrode shape.? Best, Oula On Mon, 2023-01-30 at 12:11 +0100, G?lce Lale wrote: > Hi Oula, > > I just wanted to clarify: the coordinate (x,y,z) defines the location > of the electrode in the space, therefore, the z axis does not > determine the distance of the electrode to the skin. As it states in > the website the?coordinates do not need to be exactly in the skin > surface, as SimNIBS automatically finds the closest point in the skin > surface. Therefore, whatever I give as the coordinates of the > electrode, SimNIBS will place my electrodes on to the closest points > to the skin surface. > ? ? ? ?Otherwise, how can I state in the script or in the gui that I > would like to position the electrodes on to the skin? There is a skin > distance parameter for the TMS electrodes, however, I could not see > that for tDCS electrodes. > > ? ? ? ?Thank you for your help in advance. > ? ? ? ?Best wishes, > ? ? ? ?G?lce > > > > On 27 Jan 2023, at 14:55, Oula Puonti wrote: > > > > Hi G?lce, > > > > You can just take the center coordinate (x,y,z) for the electrode > > from > > the MRI, put that in the GUI (or a script), and project the > > coordinate > > to the skin surface. This will keep the x and y coordinates (more > > or > > less) the same but set the z so that the position is on the skin. > > After > > that, when you define the electrode shape, just add a 2mm gel layer > > and > > that should be it. > > > > Best, > > Oula > > > > > > On Wed, 2023-01-25 at 14:15 +0100, G?lce Lale wrote: > > > Dear Oula, > > > Thank you for the help. We were able to label electrode gel as > > > background in the segmentation. However, when deriving our > > > electrode > > > center coordinates, we still define the top of the electrode gel. > > > We > > > know that we apply 2mm of electrode gel on top of the electrodes. > > > Thus, the coordinates acquired from the MRI image should be 2mm > > > below, so that they are at the actual skull height.? > > > How do we convert length measures such as 2mm into world > > > coordinates > > > which SimNIBS uses? And, can I find information on this on the > > > website? > > > Thank you for your time. > > > Best wishes, > > > G?lce > > > > > > > On 20 Jan 2023, at 19:11, Oula Puonti wrote: > > > > > > > > Hi G?lce, > > > > > > > > You should leave them out, i.e., label them as background. > > > > SimNIBS > > > > places the electrodes automatically during the simulation, so > > > > you > > > > don't > > > > need to add them to the headmodel yourself. > > > > > > > > You can record the center coordinate of the electrodes from the > > > > MRI > > > > scans and pass that to the simulation so that the electrodes > > > > are > > > > placed > > > > correctly. > > > > > > > > Best, > > > > Oula > > > > > > > > > > > > On Fri, 2023-01-20 at 17:25 +0100, G?lce Lale wrote: > > > > > Hi Oula, > > > > > > > > > > Thank you very much for your response, I will try it with > > > > > charm > > > > > and > > > > > SimNIBS4. > > > > > I would like to clarify something and ask for your > > > > > opinion.?What > > > > > tissue the electrodes should be segmented as? Should they be > > > > > left > > > > > out > > > > > of the segmentation? Or be segmented as one of the other 15 > > > > > tissues? > > > > > > > > > > Thank you for your help in advance. > > > > > Best wishes, > > > > > G?lce > > > > > > > > > > > On 17 Jan 2023, at 19:54, Oula Puonti > > > > > > wrote: > > > > > > > > > > > > Hi G?lce, > > > > > > > > > > > > I would consider this a segmentation error. You might want > > > > > > to > > > > > > try > > > > > > the > > > > > > new segmentation method (charm) included in simnibs version > > > > > > 4. > > > > > > In > > > > > > my > > > > > > experience it does a bit better job on ignoring the > > > > > > electrodes > > > > > > in > > > > > > the > > > > > > type of MRI data you have. > > > > > > > > > > > > The other option is that you edit the skin masks, which are > > > > > > inside > > > > > > the > > > > > > MASK_prep folder, manually and then re-run the surface and > > > > > > volume > > > > > > masking steps. > > > > > > > > > > > > The manual editing process was made easier in the new > > > > > > version, > > > > > > see > > > > > > here:? > > > > > > > > > > > > https://simnibs.github.io/simnibs/build/html/tutorial/advanced/fix_headmodel.html > > > > > > > > > > > > so you might want to consider using SimNIBS4 in any case. > > > > > > > > > > > > Best, > > > > > > Oula > > > > > > > > > > > > > > > > > > On Tue, 2023-01-17 at 15:50 +0100, G?lce Lale wrote: > > > > > > > Dear SimNIBS Team, > > > > > > > We conduct post-hoc modelling for each subject using T1 > > > > > > > and > > > > > > > T2 > > > > > > > images > > > > > > > acquired while the participant was in the scanner with > > > > > > > the > > > > > > > tDCS > > > > > > > electrodes attached. Here SimNIBS headreco images the 2mm > > > > > > > layer > > > > > > > of > > > > > > > electrode paste and includes in in the head mesh but > > > > > > > segments > > > > > > > it > > > > > > > as > > > > > > > skin (see attached images). > > > > > > > According to SimNIBS skin conductance is 0.465 s/m and > > > > > > > the > > > > > > > electrode > > > > > > > material conductivity is 29.4 s/m. One would expect the > > > > > > > Ten20 > > > > > > > Electrode paste which is applied with a 2mm thickness > > > > > > > between > > > > > > > the > > > > > > > electrode and skin to have a different measure. However, > > > > > > > since it > > > > > > > is > > > > > > > being considered and modelled as skin this could results > > > > > > > in > > > > > > > deviations in the electric field modelling. > > > > > > > How do we account/solve this? > > > > > > > Could we model the electrodes 2mm below the head surface, > > > > > > > knowing > > > > > > > that the outer 2mm thickness of the skin are actually due > > > > > > > to > > > > > > > the > > > > > > > paste? Thus, modelling the electrodes on the ?actual? > > > > > > > skin > > > > > > > outer > > > > > > > layer (and not on top of the paste). SimNIBS then allows > > > > > > > us > > > > > > > to > > > > > > > specify past + electrode thickness. Where we assume > > > > > > > SimNIBS > > > > > > > calculates a different conductivity measure for both. > > > > > > > Is there an alternative solution to best account for the > > > > > > > change > > > > > > > of > > > > > > > conductance? > > > > > > > Thank you for your help in advance. > > > > > > > Best wishes, > > > > > > > G?lce? > > > > > > > > > > > > > > G?lce Lale > > > > > > > MSc Neurosciences > > > > > > > > > > > > > > _______________________________________________ > > > > > > > Simnibs-discuss mailing list > > > > > > > Simnibs-discuss at drcmr.dk > > > > > > > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss > > > > > > > > > > > > > > > From oulap at drcmr.dk Mon Jan 30 17:57:57 2023 From: oulap at drcmr.dk (Oula Puonti) Date: Mon, 30 Jan 2023 17:57:57 +0100 Subject: [Simnibs-discuss] SIMNIBS In-Reply-To: References: Message-ID: Hi Marya, You don't need freesurfer to do the segmentation. As far as viewing the results you can use any viewer you like, and we have implemented a lightweight html viewer (see charm_report.html inside the m2m-folder) that you can use to quickly check the output. If you specifically prefer freeview for visualizing the scans, then you need freesurfer. Best, Oula On Sun, 2023-01-29 at 17:21 +0300, Marya Alhaj wrote: > Dear sir/madam: > > I am a 4th year biomedical engineering student, I have a research > project on SIMNIBS so I wonder if I have to download Freesurfer to > view volume space results and do the segmentation in the SIMNIBS > current edition ? > > Yours sincerely, > Marya Alothman. > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss From YWang1 at MGHIHP.EDU Mon Jan 30 23:33:01 2023 From: YWang1 at MGHIHP.EDU (Wang, Yuchao) Date: Mon, 30 Jan 2023 22:33:01 +0000 Subject: [Simnibs-discuss] Generating individual tissue STL from MSH file Message-ID: Hello SimNIBS team, It seems like charm in 4.0 no longer automatically generates individual tissue .stl files and I'm having trouble extracting them from the .msh file. I couldn't locate any commands (e.g. here) that exports .stl based on the physical surfaces in .msh.opt. Could you provide some help? Thanks a lot and thank you for this great program! Yuchao The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline . Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: