SESSION

This is the basis of a SimNIBS simulation. It contains information about the head mesh, the simulations to be performed, the post-processing steps and the output folder.

Initialization

  • Python

    from simnibs import sim_struct
    s = sim_struct.SESSION()
    

  • MATLAB

    s = sim_struct('SESSION');
    

Attributes

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

    • Description Name of head mesh file (given that you are in the m2m_ernie folder then subID.msh file)

    • Example: Python/MATLAB

    s.fnamehead = 'ernie.msh'
    

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

    • Description Name of output folder

    • Example: Python/MATLAB

    s.pathfem = 'simulation_outputs/'
    

  • fields: string (Python)/character array (MATLAB), optional

    • Description: Fields to be output. Any combination of

      • ‘v’ for voltage (in V)

      • ‘e’/’E’ for electric field magnitude/vector (in V/m)

      • ‘j’/’J’ for current density magnitude/vector (int A/m2).

    • Default: ‘eE’

    • Example: Python/Matlab

    s.fields = 'eEjJ'
    

  • poslist: list (Python)/cell array (MATLAB)

    • Description: List or either TDCSLIST or TMSLIST data structures

    • Note: In Python, this attribute does not need to be accessed directly. The user can use the add_tdcslist and add_tmslist methods instead.

  • open_in_gmsh: bool, optional

    • Description: Whether to open the simulation results in Gmsh after finishing the simulation

    • Default: True (Python)/ False (MATLAB)

    • Reference: Visualization tutorial

  • map_to_surf: bool, optional

    Warning

    Does not work in headreco models ran with the --no-cat option.

  • map_to_fsavg: bool, optional

    Warning

    Does not work in headreco models ran with the --no-cat option.

  • map_to_vol: bool, optional

    • Description: Whether to map the fields to a NIfTI volume. The NifTI volume will be in the same space as the m2m_subID/T1fs_conform.nii.gz file.

    • Default: False

    • Reference: SimNIBS 2.1 tutorial paper

  • map_to_mni: bool, optional

    • Description: Whether to map the fields to the MNI template using a non-linear transformation.

    • Default: False

    • Reference: SimNIBS 2.1 tutorial paper

  • tissues_in_niftis: list of tissue indices, or str (‘all’), optional

    • Description: List of the tissues for which the data will be interpolated to the niftis. To get fields everywhere, set to ‘all’.

    • Default: 2 (i.e. gray matter)

  • subpath: string (Python)/character array (MATLAB), optional

    • Description: Name of m2m_subID* folder

    • Default: Automatically finds the m2m_subID/ folder based on fnamehead.

    • Note: Only required when map_to_surf, map_to_fsavg, map_to_vol or map_to_mni are set to true. Only needs to be set by the user if the .msh file was moved or renamed

  • fname_tensor:string (Python)/character array (MATLAB), optional

    • Description: Name of NIfTI file with conductivity tensors

    • Default: Automatically finds the file d2c_subID/dti_results_T1space/DTI_conf_tensor.nii.gz based on fnamehead.

    • Note: Only needed for simulations with anisotropic conductivities. And only needs to be set by the user if a file other than the above is to be used.

  • eeg_cap: string (Python)/character array (MATLAB), optional

    • Description: Name of .csv file with EEG electrode positions

    • Default: Automatically finds the file subpath/eeg_positions/EEG10-10_UI_Jurak_2007.csv based on fnamehead or subpath

    • Note: Only needed when setting TES electrodes of TMS coil positions using EEG electrode names. Only needs to be set by the user if not using the standard .csv cap file.