mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

[ENH] Create functions to read Epochs and Evoked Neuroscan formats

Open withmywoessner opened this issue 1 year ago • 13 comments

Reference issue

#12367

What does this implement/fix?

Add functions to read .avg (Evoked) and .eeg (Epochs) Neuroscan files

withmywoessner avatar Jan 28 '24 03:01 withmywoessner

@withmywoessner you wrote a comment that I got pinged on but it's gone, did you delete it? If so hopefully it's because it's resolved :slightly_smiling_face: Or maybe #12393 is related? In any case happy to help if needed

larsoner avatar Jan 29 '24 14:01 larsoner

@larsoner Just curious, do you know why there is no BaseEvoked class? Is it just because its much simpler than the other data classes?

withmywoessner avatar Feb 04 '24 20:02 withmywoessner

it was introduced when we created the EvokedArray class.

Message ID: @.***>

agramfort avatar Feb 04 '24 20:02 agramfort

There is @agramfort? I was just curious why Epochs and Raw both inherit from a BaseEpochs and BaseRaw class, but Evoked does not.

withmywoessner avatar Feb 04 '24 22:02 withmywoessner

I think because evoked data are always preloaded we decided Evoked could just be the base for other classes like EvokedArray or EvokedMFF (if we have that class, can't remember). For epochs and raw which allow loading on the fly things are more complicated.

In principle we could have BaseEvoked and Evoked would inherit from that (and otherwise just be a pass). One way forward would be to make Evoked an alias for BaseEvoked, and EvokedFIF be what's returned by read_evokeds. I don't think this would cause code churn for users or even our code base. But I haven't thought about it thoroughly.

larsoner avatar Feb 04 '24 23:02 larsoner

Thnaks! @larsoner So you do think I should make a CNTEvoked class that inherits from Evoked or just call the EvokedArray constructor in the reader? Most of the io file epochs reader functions (which don't have an evoked reader) call <FileType>Epochs constructor which inherits from BaseEpochs. The exception to this is the FieldTrip module which calls the Evoked/Epochs/Raw-Array constructor in its reader functions.

withmywoessner avatar Feb 05 '24 01:02 withmywoessner

make an EvokedArray as done eg by read_evoked_besa

Message ID: @.***>

agramfort avatar Feb 05 '24 08:02 agramfort

I had another question about how Evoked works @larsoner. The Neuroscan .avg Evoke-like files have a parameter for number of rejected epochs. I see that EvokedArray has a parameter in the constructor for nave (Number of averaged epochs.), but nothing for number of rejected. I would like to include the .avg rejected epochs in the EvokedArray somehow.

Questions: Do you recommend I just put this in comment (Comment on dataset. Can be the condition. Defaults to ‘’.) ?

Do you know if other evoked file readers deal with this? I didn't see any.

Also, this is probably unnecessary, but do you think it could be worthwhile to add a nreject parameter to the EvokedArray to include the number of rejected epochs at some point?

withmywoessner avatar Feb 06 '24 20:02 withmywoessner

Also let me know if I am pinging too much. I never know if it's better just to post a reply without the ping.

withmywoessner avatar Feb 06 '24 20:02 withmywoessner

Evoked only knows nave so not the number of dropped. The Epochs do know this. Yes you could use the comment for this...

Message ID: @.***>

agramfort avatar Feb 07 '24 08:02 agramfort

Also, this is probably unnecessary, but do you think it could be worthwhile to add a nreject parameter to the EvokedArray to include the number of rejected epochs at some point?

@withmywoessner Can you say more about why you want to preserve that information? If you loaded a Neuroscan .avg file into MNE, and the "number of rejected epochs" was available as an attribute of Evoked, how would you use that information? (I'm trying to determine if this is a niche or nice-to-have information, or if important aspects of your workflow might depend on knowing it). For example, nave is needed because it is used to scale the noise covariance when doing inverse imaging (it's a rough proxy for SNR).

drammock avatar Feb 07 '24 16:02 drammock

@drammock I think I mainly just want it for quality control purposes to see how many epochs.

withmywoessner avatar Feb 07 '24 16:02 withmywoessner

ok, in that case I would agree with @agramfort: put the info in the comment attribute

drammock avatar Feb 07 '24 17:02 drammock