Closed kylemath closed 4 years ago
These are the same locations that we would digitize into the .elp file for each participant
>>> raw_intensity.info['chs'][0]
{
'loc': array([-4.01877067e-02, 4.46422957e-02, 1.23576592e-01, -4.16132047e-02,
2.67997753e-02, 1.29904394e-01, -3.76195887e-02, 6.32285163e-02,
1.15728028e-01, 7.60000000e+02, nan, nan]),
'unit_mul': 0,
'range': 1.0,
'cal': 1.0,
'kind': 1100 (FIFFV_FNIRS_CH),
'coil_type': 302 (FIFFV_COIL_FNIRS_RAW),
'unit': 107 (FIFF_UNIT_V),
'coord_frame': 0 (FIFFV_COORD_UNKNOWN),
'ch_name': 'S1_D1 760',
'scanno': 1,
'logno': 1}```
# Store channel, source, and detector locations
# The channel location is stored in the first 3 entries of loc.
# The source location is stored in the second 3 entries of loc.
# The detector location is stored in the third 3 entries of loc.
# NIRx NIRSite uses MNI coordinates.
good start to this in https://github.com/kylemath/pyoptical/pull/12, still working
here is the pull request in which they made the nirx loader: https://github.com/mne-tools/mne-python/pull/6674/files/b02600eba9e46d7b6738153d3753c4bfbc447d44
Note that the meg and fnirs parameters of pick_types() accept strings as well as boolean values, to allow selecting only magnetometer or gradiometer channels (via meg='mag' or meg='grad') or to pick only oxyhemoglobin or deoxyhemoglobin channels (via fnirs='hbo' or fnirs='hbr', respectively).
A third way to pick channels from an Info object is to apply regular expression matching to the channel names using mne.pick_channels_regexp(). Here the ^ represents the beginning of the string and . character matches any single character, so both EEG and EOG channels will be selected:
print(mne.pick_channels_regexp(info['ch_names'], '^E.G'))
gonna keep this open so we can test on the head plots
@kuziekj - i think you've already solved this but check this out: https://mne.tools/dev/overview/implementation.html#dig-formats
continuing discussion in https://github.com/kylemath/pyoptical/issues/16
need to load in source detector locations from .elp file use .mtg file to find used locations get their location and write them into the MNE raw object
raw.info['dig'] - has the .elp information in it raw.info['chs'] - has a 3d location for each channel