Optional Tools

Optional tools are panels you switch on per project in Settings ▸ Extensions. An enabled panel gets its own row under Extensions in the nav rail. Quick notes is not a panel: it is always available, as a global drawer opened from the command palette or its shortcut.

Settings, Extensions tab: a checkbox per feature panel, with every panel listed under Extensions in the sidebar Settings (⌘,) ▸ Extensions. One checkbox per panel; enabled panels appear under Extensions in the sidebar.

The panels are Source, Cluster permutation, NIfTI group averaging, Nilearn visuals, the 3D visual exporter and EEG caps.

Computational tools use the same layout as the main run pages: inputs on the left, with the plan and live terminal on the right. Submitted jobs remain available in that terminal after completion and when you return to the page. Quick notes remains an autosaving note drawer, not a job runner.

The 3D visual exporter adds Scene / Terminal tabs. Its scene follows the selected export type; see the export preview guide.

The 3D visual exporter panel: subject and simulation, the four export modes, and the cortical-regions options The 3D visual exporter covers cortical regions, field vectors, montages and sub-cortical structures.
The Cluster permutation panel: classification or correlation, a subject table with responses, and the test and cluster settings Cluster permutation provides non-parametric group-level statistics.
The Source panel: a subject table showing which subjects have a head model, and the forward-solution settings Source builds EEG forward models for the selected subjects.

Source (EEG forward model)

Source builds an MNE-compatible EEG forward model from a subject’s SimNIBS head model, for EEG source reconstruction. Pick subjects that have a head model (m2m_<id>), an EEG net and the fsaverage source spacing (5, 6 or 7). Each subject gets, under derivatives/SimNIBS/sub-<id>/forward/:

  • sub-<id>_net-<net>-fwd.fif — the forward solution (gain matrix);
  • sub-<id>_net-<net>-src.fif — the cortical source space;
  • sub-<id>_net-<net>-morph.h5 — a source morph onto fsaverage;

plus the point-electrode leadfield (*_leadfield.hdf5) and the head↔MRI transform (*-trans.fif) they are built from. The FEM leadfield is computed once per subject and net; a re-run reuses it while the net CSV and head mesh are unchanged. Source needs MNE-Python, which the Docker image includes.

By default the head frame comes from the EEG net’s own template fiducials. To build the forward in a real recording’s head frame, call it from Python with that recording’s Info (with digitized fiducials) or an explicit head→MRI transform:

import mne
from tit.source.config import ForwardConfig
from tit.source.forward import prepare_forward

cfg = ForwardConfig(eeg_net="GSN-HydroCel-185")
raw = mne.io.read_raw("sub-101_task-rest_eeg.fif")
fwd, src, morph = prepare_forward("101", cfg, info=raw.info)
# or: prepare_forward("101", cfg, trans=mne.read_trans("sub-101-trans.fif"))

Pass one or the other, not both. info must carry the recording’s own digitized LPA, Nasion and RPA points (info["dig"]); its head frame is coregistered to the head model’s fiducials. An info with no digitization, or whose fiducials MNE filled in itself (set_montage with a montage that has none), is refused before any computation. trans must map MNE head → MRI coordinates and is used as is. Either one always rebuilds the forward, reusing the cached FEM leadfield.

fsaverage mapping (Simulator and API)

Mapping simulation fields to fsaverage is not an extension: for new simulations, enable Map fields to fsaverage in a Simulator job’s settings before running it. To map outputs that already exist, without rerunning the simulation, use the Python API from a notebook or terminal:

from tit import get_path_manager
from tit.source.config import FsavgMapConfig
from tit.source.fsaverage import project_fields_to_fsaverage

get_path_manager()  # auto-detects the project inside the container (/mnt/<name>)
results = project_fields_to_fsaverage(
    [("101", "L_Insula")],
    FsavgMapConfig(fields=("TI_max", "TI_normal"), fsaverage_spacing=5),
)

For a terminal run, save that code as a script and run simnibs_python map_fields.py. An explicit path must exist: get_path_manager("/mnt/<name>") raises for a directory that does not.

Each projection is written beside its simulation as Simulations/<sim>/fsaverage/sub-<id>_sim-<sim>_space-fsaverage<N>_fields.msh: the fsaverage central surfaces (left hemisphere, then right) with each field as a node field, the layout SimNIBS uses for its own fsavg_overlays. Open it in the Viewer (an MNI-space scene lists it under the simulation’s meshes) or in Gmsh, which picks up the .msh.opt view file beside it. A .json sidecar with the same name records the subject, simulation, fields and whether the run was a carrier-only control. To read the values in a script, run it with simnibs_python; render_fsaverage_map paints any such per-vertex array on the inflated cortex (lateral and medial views of both hemispheres), its second argument being the fsaverage spacing N:

from simnibs.mesh_tools import mesh_io
from tit.plotting.nilearn import render_fsaverage_map

mesh = mesh_io.read_msh(path)
ti_max = mesh.field["TI_max"].value  # one value per fsaverage vertex, lh then rh
render_fsaverage_map(ti_max, 5, cmap="inferno", out_path="ti_max.pdf")

Electrode placement is the Simulator’s free-hand mode, and subject information is the Overview page; neither is an extension panel.