-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional support for MFF #8038
Comments
Have you looked at the MNE-Python |
no objection on my side is we match the same performance for reading files
and we support the preload option.
maybe start with evoked and epochs as there is not code for this at the
moment
… |
I actually hadn't looked at the |
Good idea to pilot on the |
That is certainly possible in principle... can you say a bit more about what kind of metadata is stored in MFF events? Is it the same for continuous, epoched, and averaged data? The |
Below is an example of a single event from an event track XML. This is a good example of an event generated by a stimulus presentation device at recording. I think the There are event tracks in continuous, epoched, and averaged MFF files, although I am not sure how events are preserved in averaged files, as the time scale is not preserved. The
|
as Annotations and events are not as versatile as MFF format I would
suggest to add a function to read the
event file and eventually get metadata as output. If you can accept to
attach Annotations taking
the 3 columns, onset, duration and description then it's ok to attach it to
Raw. So you come up with
a description with `/` separators to make keys in event_id down the line so
that you can index
your epochs as explained in :
https://mne.tools/dev/auto_tutorials/epochs/plot_10_epochs_overview.html#subselecting-epochs
… |
So @agramfort suggests 2 possibilities:
Personally I am open to a third option which is attaching a dataframe-like metadata object to |
Converting the event track XML to a DataFrame seems like the most attractive option as far as easy access to all the event attributes. However, we do want to be able to create What if we store the events in a DataFrame separate from the I think it will be easiest to first focus on implementing reading of segmented and averaged MFFs with mffpy to see how well this works. From there we can look at reading of continuous MFF files and decide how we want to handle events. |
Agreed.
That is indeed an elegant-sounding approach.
hmm... perhaps an API like
Sounds good. |
one idea is to have a function events_from_frame or events_from_dataframe
that converts the dataframe to events/event_id like we have for
annotations. So we keep one way to build epochs.
… |
I like this idea from a usability standpoint. This way someone processing an MFF could keep their events in the DataFrame format throughout the workflow. |
This was my earlier suggestion @agramfort, but it would not allow the (really nice) feature of the events dataframe automatically being used to populate the But before all that, it sounds like the first steps are to simply read the already-epoched and already-averaged data formats, and come back to the event parsing later. |
But before all that, it sounds like the first steps are to simply read the
already-epoched and already-averaged data formats, and come back to the
event parsing later.
+1
|
@drammock @agramfort would it be wise to wait for some of the other MNE maintainers to get on board before beginning work on the reading of epoched and averaged MFFs? Or do you guys think there will be enough support from the others to merge something like this? |
I have not seen the diff nor CIs green so I cannot promise anything. But if
we want mne support
for such files I don't see any other way.
… |
I see no reason not to start work on the Epoched/Averaged reader. We seem to mostly agree on the big picture, and it's easier to hammer out the little details once there's an open PR that we can look at. |
Sounds good. I will start coordinating with my team on this. |
I would suggest to start with making a PR to add only |
Sounds like a good approach. Probably best not to bite off more than we can chew for the first PR. |
I was trying to do coregistration with some (
|
@christianbrodbeck, great point. How can we evaluate if |
If nobody else is working on it already I could start translating the |
Sure, would be good! But actually I think the issue you're encountering with @christianbrodbeck let me know which of the two PRs you're interested in working on. If it's just the mffpy bit, I can add the native-reader bits + tests first. |
They're potentially more interrelated in that the fiducials are currently never read (as far as I could tell), and I suspect implementing that would be more straight forward with |
@christianbrodbeck I am not exactly sure what these digitizer points and fiducials are, but I suspect this info is contained in the |
Thanks @ephathaway , I saw this in
|
I'm not sure. I believe the |
|
@christianbrodbeck you can view all of the possible
|
I would like to add a function to write one or more The question is where to put it? I noticed the |
To stick to the |
Sounds good! I will work on a PR in the next couple of weeks. |
@larsoner to avoid having a lot of MFF specific code in
|
Sounds good. If you need to avoid a circular import problem you can nest the import |
@larsoner mind taking a look at mne-tools/mne-testing-data#87? I'll need this to properly test the export function. |
On behalf of Brain Electrophysiology Laboratory, we would like to add support for all different flavors of MFF. The
mne.io.egi
module can be used to read in raw MFF files, but we would like to be able to read MFF segmented files (analogous toEpochs
class) and MFF averaged files (analogous toEvoked
class). We would also like to be able to convertBaseRaw
,Epochs
, orEvoked
objects to continuous, segmented, and averaged MFF files respectively and write these as output files. Finally, we would like to be able to read and store a wider range of event track information from MFF files. MFF event track XML files contain several attributes for each event, such as label, duration, and response, that are not currently captured when reading in raw MFF files.In order to address these requests, we propose using mffpy, a Python MFF reader/writer created by BEL for handling MFF inputs and outputs. This Python package is capable of reading and writing each of the different flavors of MFF as well as parsing individual XML files within an MFF directory. Our general proposal would be to make mffpy a dependency of MNE and then restructure the
mne.io.egi
module to read in MFF files with mffpy and then convert them to the appropriate object (Raw, Epochs, or Evoked). We also want to add a module that takes Raw, Epochs, and Evoked objects and converts them to an mffpyWriter
object so that they can be output as MFF files. As far as event tracks, we are able to fully parse event track XML files with mffpy. We may need to create a new type of MFF events class to store this information, as it appears that event info is currently stored in a simple array with relative start time and event type.We have developers at BEL that would be happy to implement these features. We are also happy to answer any questions about mffpy and how it could increase the functionality of MNE.
The text was updated successfully, but these errors were encountered: