from simnibs import optimization opt = optimization.TDCSoptimize() target = opt.add_target()
opt = opt_struct('TDCSoptimize'); opt.target(1)
positions: Nx3 list/array of floats (Python/MATLAB)
Desctiption: Positions where the field is to be controlled. The positions are in world coordinates in subject space (see here or more information about coordinates in SimNIBS). SimNIBS finds the position in the mesh closest to the input position. These can be obtained by
Transforming positions from MNI space using the
mni2subject_coordsPython and MATLAB functions
m2m_subID/T1fs_conform.nii.gzfile in a NifTi reader and record the world coordinates.
tdcs_leadfield/subID_ROI.mshfile in gmsh, click in Mesh -> Inspect and click in the model
directions: ‘normal’, None/’none’, or Nx3 list/array of floats (Python/MATLAB), optional
Description: Direction of the field to be controlled.
If set to
'normal'(default) and the leadfield was run with
map_to_surf(default) or surface ROIs, will control the electric fields in the normal direction.
If set to
'none'(MATLAB), will control electric field strength (norm).
indexes: Nx1 list/array of ints (Python/MATLAB), optional
Description: As an alternative to
positions, you can select the node index or the element index, depending on the type of leadfield.
Default: Get the points closest to the
intensity: float, optional
Description: Intensity of the field (E or J, see TDCSLEADFIELD) to be reached on average on the target and along the given direction. To optimize for intensity at the target rather than focality, you can set this value to a large number (eg: 100). With negative values, the direction will be inverted.
max_angle: float, optinal
Description: Maximum angle between field and target direction.
Default: No maximum
This condition is only fulfilled in the mean across the target region, and not point-wise. Does not work in multi-target optimization.
radius: float, optional
Description: All points in the radius around the specified position/index to be added to the target area, in mm. Set to 0 if you want the target to be only the specified positions or indices.
tissues: list/array of ints (Python/MATLAB), optional
Descrption: List of tissue indices where the target is defined. Leave empty if all tissues in the leadfield. This allows you to prevent that nearby tissue regions are included in the target (e.g. white matter or CSF bordering a target in GM , assuming that all three tissues were included in the leadfield).
Default: All tissues