Skip to content

TI

tit.sim.TI

Two-channel Temporal Interference (TI) simulation.

Implements :class:TISimulation, the concrete BaseSimulation subclass for standard two-channel TI stimulation. The session structure mirrors the official SimNIBS TI example:

  • SESSION with two TDCS lists (one per channel)
  • deepcopy pattern for the second channel
  • TI_max computed with :func:tit.calc.envelope_max on cropped meshes
  • one central cortical surface mesh with every volume field and TI_normal (:func:tit.calc.envelope along its node normals)

Outputs: TI/mesh/<montage>_TI.msh with the selected TI_max, TI_avg, hf_peak, hf_rms and hf_power_density, and TI/mesh/surfaces/<montage>_TI_central.msh. Per-channel E-fields are not retained on them; those live on the high_Frequency/ carrier meshes.

See Also

BaseSimulation : Abstract base class providing the run template. mTISimulation : N-channel 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 two-channel TI simulation.

Pipeline
  1. Set up BIDS output directory structure.
  2. Visualize electrode placement.
  3. Build SimNIBS SESSION, run FEM.
  4. Compute TI_max/TI_avg/hf_peak/hf_rms/ hf_power_density (volume mesh) and the central surface with them and TI_normal.
  5. Organize outputs; with map_to_vol, write one NIfTI per field (whole, grey and white matter).
See Also

BaseSimulation : Parent class with shared setup and template run. mTISimulation : Multi-channel variant for 4 or more channels.

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)