You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm reading in an EDF file where the analog channels are labeled as EEG. I'm trying to figure out how to set these to misc, but haven't found an easy way to do this. I've learned that it's usually not a good idea to directly change fields in the "info" attribute, so I wonder if there's a good way to do this that I'm not thinking of?
from the docstring (I also tried it and it returned an error)
"""Rename channels and optionally change the sensor type.
Note: This only changes between the following sensor types: eeg, eog,
emg, ecg, and misc. It also cannot change to eeg.
Parameters
----------
info : dict
Measurement info.
mapping : dict
a dictionary mapping the old channel to a new channel name {'EEG061' :
'EEG161'}. If changing the sensor type, make the new name a tuple with
the name (str) and the new channel type (str)
{'EEG061':('EOG061','eog')}.
I'm busy (and not paid to work on MNE). Also, I just realized it's not a typo. There is a good reason:
To define an EEG sensor you need to adjust dig and define a new sensor. That is more complex. It should IMO go in a new function e.g. mne.channels.define_sensor
sounds like a useful API. We could then leave it to the user to provide as much of the information as needed. If nothing additional is provided we would just use defaults and change the sensor type.
@teonlamont: yes what @Eric89GXL said, plus you need to modify channels, which gets complex fast when you are really changing channel type. The channel type changes mentioned here are really more about name than type (the difference between eog, emg, ecg, and misc is not really important for anything except as a name: same units, attributes etc.). Hence, why I think changing the type should be a different API, this was just a weird exception due to hardware vendors.
IMO, it is a mistake to incorporate SEEG in this function, as these should be done properly as sensor types, and should be added to dig etc. Perhaps, this discussion will spark some inspiration in people.
Activity
dengemann commentedon Mar 29, 2015
@choldgraf take a look at
mne.rename_channels. Maybe it can do the job for you.choldgraf commentedon Mar 29, 2015
ah perfect. out of curiosity why can't you change the type to eeg?
dengemann commentedon Mar 29, 2015
Hum?
choldgraf commentedon Mar 29, 2015
from the docstring (I also tried it and it returned an error)
dengemann commentedon Mar 29, 2015
@dgwakeman ??
agramfort commentedon Mar 29, 2015
this is crazy. It should not be the case.
alos eeg should be in human2fiff dict in function.
PR more than welcome !!!
teonbrooks commentedon Mar 29, 2015
@choldgraf there's a parameter,
miscin all the eeg readers when you first load the data.choldgraf commentedon Mar 29, 2015
Ah that's useful as well, thanks :)
On Sun, Mar 29, 2015 at 7:50 AM, Teon [email protected] wrote:
dgwakeman commentedon Mar 30, 2015
Yeah, that is a typo. It is meant to say MEG. I'll fix it later this week. Unless someone else wants to tackle this easy PR.
agramfort commentedon Mar 30, 2015
dgwakeman commentedon Mar 30, 2015
I'm busy (and not paid to work on MNE). Also, I just realized it's not a typo. There is a good reason:
To define an EEG sensor you need to adjust dig and define a new sensor. That is more complex. It should IMO go in a new function e.g. mne.channels.define_sensor
This is a much bigger PR
dengemann commentedon Mar 30, 2015
sounds like a useful API. We could then leave it to the user to provide as much of the information as needed. If nothing additional is provided we would just use defaults and change the sensor type.
teonbrooks commentedon Mar 31, 2015
wait, @dgwakeman why should dig be adjusted? dig is usually reserved for digitized head points and hpi points, not for sensors.
larsoner commentedon Mar 31, 2015
I think
eegchannels end up in ourinfo['dig']when we do M/EEG recordingsdgwakeman commentedon Mar 31, 2015
@teonlamont: yes what @Eric89GXL said, plus you need to modify channels, which gets complex fast when you are really changing channel type. The channel type changes mentioned here are really more about name than type (the difference between eog, emg, ecg, and misc is not really important for anything except as a name: same units, attributes etc.). Hence, why I think changing the type should be a different API, this was just a weird exception due to hardware vendors.
IMO, it is a mistake to incorporate SEEG in this function, as these should be done properly as sensor types, and should be added to dig etc. Perhaps, this discussion will spark some inspiration in people.
agramfort commentedon Mar 31, 2015
choldgraf commentedon Mar 31, 2015
Do you think that you could implement the ability to rename channel types to "eeg" in C++, with pen and paper?
agramfort commentedon Mar 31, 2015
teonbrooks commentedon Apr 6, 2015
there's now pr #1932 to tackle this issue. currently it doesn't deal eeg channels in the
info['dig'].