Skip to content

TI

tit.sim.TI

2-pair Temporal Interference (TI) simulation.

Implements :class:TISimulation, the concrete BaseSimulation subclass for standard 2-pair TI stimulation. The 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.

See Also

BaseSimulation : Abstract base class providing the run template. mTISimulation : N-pair multi-channel TI variant. SimulationConfig : Configuration consumed by the simulation. run_simulation : Top-level orchestration that dispatches to this class.

TISimulation

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

Bases: BaseSimulation

Run 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.
See Also

BaseSimulation : Parent class with shared setup and template run. mTISimulation : Multi-channel variant for 4+ electrode pairs.

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)