seek_localize.convert_coord_units

seek_localize.convert_coord_units(sensors: seek_localize.electrodes.Sensors, to_unit: str, round=True, verbose: bool = True)[source]

Convert electrode coordinates between voxel and xyz.

To obtain the sensors, one can use seek_localize.bids.read_dig_bids().

Parameters
sensorsSensors

An instance of the electrode sensors with the coordinates, coordinate system and coordinate units. It is assumed that the sensors are already in mri coordinate frame. If not, then one must use convert_coord_space to convert coordinate spaces first.

to_unitstr

The type of coordinate unit to convert to. Must be one of ['mri', 'mm']. mri corresponds to voxel space of the FreeSurfer T1.mgz file.

roundbool

Whether to round the coordinates to the nearest integer.

verbosebool

Verbosity.

Returns
sensorsSensors

The electrode sensors with converted coordinates.

Notes

This function SOLELY transforms between voxel and xyz (i.e. RAS) spaces. For converting between different standardized coordinate systems like tkras and mni, then check out convert_coord_space.

References

1

FieldTrip explanation: https://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined/#details-of-the-freesurfer-coordinate-system # noqa

2

How MNE handles FreeSurfer data: https://mne.tools/dev/auto_tutorials/source-modeling/plot_background_freesurfer_mne.html # noqa

3

FreeSurfer Wiki: https://surfer.nmr.mgh.harvard.edu/fswiki/CoordinateSystems # noqa