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
- sensors
Sensors An instance of the electrode sensors with the coordinates, coordinate system and coordinate units. It is assumed that the sensors are already in
mricoordinate frame. If not, then one must useconvert_coord_spaceto convert coordinate spaces first.- to_unit
str The type of coordinate unit to convert to. Must be one of
['mri', 'mm'].mricorresponds to voxel space of the FreeSurferT1.mgzfile.- roundbool
Whether to round the coordinates to the nearest integer.
- verbosebool
Verbosity.
- sensors
- Returns
- sensors
Sensors The electrode sensors with converted coordinates.
- sensors
Notes
This function SOLELY transforms between
voxelandxyz(i.e. RAS) spaces. For converting between different standardized coordinate systems liketkrasandmni, 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