Skip to content

TI

tit.sim.TI

2-pair Temporal Interference (TI) simulation.

Session structure mirrors the official SimNIBS TI example
  • SESSION with two TDCS lists (one per electrode pair)
  • deepcopy pattern for the second pair
  • TI_max computed with TI.get_maxTI on cropped meshes
  • TI_normal computed on cortical surface overlays

Output mesh includes per-pair E-field magnitudes and TI_max, matching the reference visualisation layout.

TISimulation

TISimulation(config: SimulationConfig, montage: Montage, logger)

Bases: BaseSimulation

Runs a single 2-pair TI simulation.

Pipeline
  1. Set up BIDS output directory structure
  2. Visualize electrode placement
  3. Build SimNIBS SESSION, run FEM
  4. Compute TI_max (volume) and TI_normal (surface)
  5. Extract GM/WM meshes, convert to NIfTI, organize outputs
Source code in tit/sim/base.py
def __init__(self, config: SimulationConfig, montage: Montage, logger):
    self.config = config
    self.montage = montage
    self.logger = logger
    self.pm = get_path_manager()
    self.m2m_dir = self.pm.m2m(config.subject_id)