[Simnibs-discuss] Questions about changes in SimNIBS 4

Oula Puonti oulap at drcmr.dk
Tue Jan 17 00:42:40 CET 2023


Hi Roch,

1: There is an affine transformation from the charm atlas space to the
image space, but that is now stored in 

m2m_<subid>/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



More information about the Simnibs-discuss mailing list