mne_bids.template_to_head#

mne_bids.template_to_head(info, space, coord_frame='auto', unit='auto', verbose=None)[source]#

Transform a BIDS standard template montage to the head coordinate frame.

Parameters:
infomne.Info

The mne.Info object with information about the sensors and methods of measurement. The info is modified in place.

spacestr

The name of the BIDS standard template. See https://bids-specification.readthedocs.io/en/latest/appendices/coordinate-systems.html#standard-template-identifiers for a list of acceptable spaces.

coord_frame‘mri’ | ‘mri_voxel’ | ‘ras’

BIDS template coordinate systems do not specify a coordinate frame, so this must be determined by inspecting the documentation for the dataset or the electrodes.tsv file. If 'auto', the coordinate frame is assumed to be 'mri_voxel' if the coordinates are strictly positive, and 'ras' ("scanner RAS") otherwise.

Warning

scanner RAS and surface RAS coordinates frames are similar so be very careful not to assume a BIDS dataset’s coordinates are in one when they are actually in the other. The only way to tell for template coordinate systems, currently, is if it is specified in the dataset documentation.

unit‘m’ | ‘mm’ | ‘auto’

The unit that was used in the coordinate system specification. If 'auto', 'm' will be inferred if the montage spans less than -1 to 1, and 'mm' otherwise. If the coord_frame is 'mri_voxel', unit will be ignored.

verbosebool | str | int | None

Control verbosity of the logging output. If None, use the default verbosity level. See the logging documentation and mne.verbose() for details. Should only be passed as a keyword argument.

Returns:
infomne.Info

The mne.Info object with information about the sensors and methods of measurement. The modified Info object.

transmne.transforms.Transform

The data transformation matrix from 'head' to 'mri' coordinates.

Examples using mne_bids.template_to_head#

08. Convert iEEG data to BIDS format

08. Convert iEEG data to BIDS format