# TDCStarget¶

## Initialization¶

• Python

from simnibs import optimization
opt = optimization.TDCSoptimize()


• MATLAB

opt = opt_struct('TDCSoptimize');
opt.target(1)


## Attributes¶

• 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_coords Python and MATLAB functions

• Opening the m2m_subID/T1fs_conform.nii.gz file in a NifTi reader and record the world coordinates.

• Opening the tdcs_leadfield/subID_ROI.msh file 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 (Python) or 'none' (MATLAB), will control electric field strength (norm).

• Defaut: 'normal'

• 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 positions.

• 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.

• Defaut: 0.2

• max_angle: float, optinal

• Description: Maximum angle between field and target direction.

• Default: No maximum

Note

This condition is only fulfilled in the mean across the target region, and not point-wise. Does not work in multi-target optimization.