Skip to content

mTI

tit.sim.mTI

N-channel Multi-channel Temporal Interference (mTI) simulation.

Implements :class:mTISimulation, the concrete BaseSimulation subclass for multi-channel TI stimulation with an arbitrary even number of channels (4, 6, 8, ...):

  • Each channel produces one HF E-field via SimNIBS TDCS.
  • The mTI envelope is the joint envelope maximum (:func:tit.calc.envelope_max) over all N channel fields jointly -- not a recursive TI-of-TI combination of per-pair envelopes (that approximation is physically invalid).
  • Channels are paired positionally: each two consecutive channels form a beating pair at a common difference frequency (channels 1 and 2 the first pair, 3 and 4 the second, and so on; on disk the channels are lettered A, B, C, D ...).

Example with 4 channels (on disk A/B/C/D)::

mTI = envelope_max([E_A, E_B, E_C, E_D])

See Also

BaseSimulation : Abstract base class providing the run template. TISimulation : Standard two-channel TI variant. SimulationConfig : Configuration consumed by the simulation. run_simulation : Top-level orchestration that dispatches to this class.

mTISimulation

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

Bases: BaseSimulation

Run a single N-channel mTI simulation (N >= 4, even).

Pipeline
  1. Set up BIDS output directory structure.
  2. Visualize electrode placement.
  3. Build SimNIBS SESSION (N TDCS lists), run FEM.
  4. Compute mTI_max from the modulation-depth envelope over all N channel fields jointly, plus its orientation-averaged companion TI_avg and the hf_peak/hf_rms/hf_power_density carrier fields (always over all N fields), 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. TISimulation : Standard two-channel variant.

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)