TMSLIST

Describes a set of TMS simulations.

Initialization

  • Python

    from simnibs import sim_struct
    s = sim_struct.SESSION()
    tms_list = s.add_tmslist()
    

  • MATLAB

    s = sim_struct('SESSION');
    s.poslist{1} = sim_struct('TMSLIST');
    

Attributes

  • fnamecoil: string (Python)/ character array (MATLAB)

    • Description: Name of coil file. Coil files come in two types

      • .nii.gz files: NIfTI files with sampled magnetic vector potentials. Recommended, allows for faster simulations. (Madsen et al., 2015)

      • .ccd files: Text files that describe the coil as a set of magnetic dipoles. Simulations with this type of coil are slower. (Thielscher and Kammer, 2004)

    • Examples: Python/MATLAB

      Select the SimNIBS model for the Magstim 70mm figure-of-eight coil

      tmslist.fnamecoil = fullfile('legacy_and_other','Magstim_70mm_Fig8.ccd');
      

    • Note: When using a coil provided by SimNIBS you only need to use the file name. If using some other coil file, please use the full path.

    • References: Madsen et al., 2015, Thielscher and Kammer, 2004

Examples

  • Set up a simulation with a coil over C3, pointing posteriorly. See the documentation on SESSION and the POSITION structures for more information.

    • Python

    from simnibs import sim_struct, run_simnibs
    # Create a SESSION structure
    S = sim_struct.SESSION()
    # Select the head mesh
    S.fnamehead = 'ernie.msh'
    # add a TMSLIST to the SESSION
    tms = S.add_tmslist()
    # Select the coil from those available in the ccd-coils subfolder
    tms.fnamecoil = os.path.join('legacy_and_other','Magstim_70mm_Fig8.ccd')
    # Add a new position
    pos = tms.add_position()
    # Place the coil over C3
    pos.centre = 'C3'
    # Point the coil towards CP3
    pos.pos_ydir = 'CP3'
    #  4 mm distance between coil and head
    pos.distance = 4
    

    • MATLAB

    % Create a SESSION structure
    S = sim_struct('SESSION');
    % Select the head mesh
    S.fnamehead = 'ernie.msh';
    % Add a TMSLIST to the SESSION
    S.poslist{1} = sim_struct('TMSLIST');
    % Select the coil from those available in the ccd-coils subfolder
    S.poslist{1}.fnamecoil = fullfile('legacy_and_other','Magstim_70mm_Fig8.ccd');
    % Place the coil over C3
    S.poslist{1}.pos(1).centre = 'C3';
    % Point the coil towards CP3
    S.poslist{1}.pos(1).pos_ydir = 'CP3';
    %  4 mm distance between coil and head
    S.poslist{1}.pos(1).distance = 4;