arnodelorme / mffmatlabio

MFF Matlab file importer and exporter
GNU General Public License v3.0
11 stars 15 forks source link

Custom MFF event field information not usable in Fieldtrip #15

Open arnodelorme opened 4 years ago

arnodelorme commented 4 years ago

When single-trial mff data is read by the v3 code, the cell names seem to be discarded. While I can see them in the event data and the .orig branch of the header, they are no longer distinguishable from other events in the trials. I’ve worked out a possible method for deducing the original cell name from the event information but it relies on making the assumption that the hdr.orig.epoch.eventlabel field never contains anything other than the cell name. Can I make that assumption? If not, would it be possible to add in some kind of marker that reliably indicates the cell name?

arnodelorme commented 4 years ago

I understood about the .type field. It was just a suggestion of how the problem might be solved. Nonetheless, the concern about mffmatlabio not providing the cell label information stands. Before we talk about possible solutions, let’s see if we can agree there is a problem. Knowing the label of a segment is critical information. This isn’t a minor issue from the standpoint of the user. Can you explain why you don’t see this as being a problem?

For example, in an oddball experiment you might have “target” and “standard”. or if you were being more complicated, they might be “target-correct”, “target-error”, “standard-correct”, and “standard-error”

arnodelorme commented 4 years ago

My personal understanding is that all the event information is in the imported dataset. This is true for EEGLAB and also for Fieldtrip in the hdr.orig.epoch.eventlabel field. I am assuming you have found a workaround Joe but if not let me know.

Pending Joe response to make sure the problem is solved and close.

jdien07 commented 4 years ago

Hi Arno. I appreciate your looking into this. I'm afraid that this problem is not solved. Let me try again. The problem is that while the raw information is in the events field, its nature and location are entirely experiment-specific. There is no way for another user or another program to be able to consistently extract the needed information without detailed instructions from the original researcher. Likewise the original researcher would have to customize their own script or manually instruct the program in how to obtain the cell information from a given file.

My impression is that NetStation does not have this problem when reading mff files because the mff file format has a dedicated field that lists the cell name for each segment that is generated when NetStation segments the data. Unfortunately the current mffmatlabio code seems to ignore this information and does not make it available to the user. I cannot imagine that it would take more than fifteen minutes to figure out where this information is stored in the mff files and to make it available in the mffmatlabio output.

At any rate, the current code leaves me in the unacceptable position as a software developer of EP Toolkit of having to explain to users that the reason the EP Toolkit is not reading their mff files correctly is due to mffmatlabio rather than my own code. Or alternatively telling users that they have to program their own script to decode the files. I presume eeglab users have the same problem, whether or not you are hearing from them. I can certainly point some aggrieved users your way if that would be helpful. Ultimately it is up to EGI how user-friendly they want to make this process and up to yourself to tell them how much adding the support would cost them.

arnodelorme commented 4 years ago

Hi Joe, OK, we are moving forward. Would you mind to share a data file and indicate which information you would want to see and that is currently not available to you. Thank you - Arno

jdien07 commented 4 years ago

you don’t need an mff file from me. all that is needed is a cell array with a length equal to the number of segments in which each cell contains the name of the corresponding segment’s condition name. The name that it was given when NetStation’s segmentation tool was used to generate it.

On Oct 11, 2019, at 22:50, Arnaud Delorme notifications@github.com wrote:

Hi Joe, OK, we are moving forward. Would you mind to share a data file and indicate which information you would want to see and that is currently not available to you. Thank you - Arno

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/arnodelorme/mffmatlabio/issues/15?email_source=notifications&email_token=AE4T4657OHRWLYPAWPZV6A3QOE3PBA5CNFSM4I76WCWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBBTU2Y#issuecomment-541276779, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4T462FRCS4TDDLEGPSKYLQOE3PBANCNFSM4I76WCWA.


Joseph Dien, PhD Senior Research Scientist Department of Human Development and Quantitative Methodology University of Maryland, College Park E-mail: jdien07@mac.com Cell Phone: 202-297-8117 http://joedien.com

arnodelorme commented 4 years ago

Discussion by email revealed that Joe uses the Fieldtrip version which does not have the option to import custom MFF fields into as types. The EEGLAB function has a wrapper and a GUI that allow users to choose which field to import for types.

The problem is that the Fieldtrip function does not accept such parameter. What I propose is to change ft_read_event and add a parameter 'typefield' that would then be passed on to the function mff_fileio_read_event. Robert @robertoostenveld, please approve and I can make the change and submit a pull request to FileIO/Fieldtrip. This is an important deal for users of the MFF format.

jdien07 commented 4 years ago

to be honest, I don’t see how this would address the concern I raised with Arno. The full mffmatlabio output is available in hdr.orig, no?

Joe

On Dec 31, 2019, at 15:24, Arnaud Delorme notifications@github.com wrote:

Discussion by email revealed that Joe uses the Fieldtrip version which does not have the option to import custom MFF fields into as types. The EEGLAB function has a wrapper and a GUI that allow users to choose which field to import for types.

The problem is that the Fieldtrip function does not accept such parameter. What I propose is to change ft_read_event and add a parameter 'typefield' that would then be passed on to the function mff_fileio_read_event. Robert @robertoostenveld https://github.com/robertoostenveld, please approve and I can make the change and submit a pull request to FileIO/Fieldtrip. This is an important deal for users of the MFF format.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/arnodelorme/mffmatlabio/issues/15?email_source=notifications&email_token=AE4T465FND55CAARKNQYCB3Q3OTA3A5CNFSM4I76WCWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH4UV5Y#issuecomment-569985783, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4T46Z6BJS5OVPPRIWS4YTQ3OTA3ANCNFSM4I76WCWA.


Joseph Dien, PhD Senior Research Scientist Department of Human Development and Quantitative Methodology University of Maryland, College Park E-mail: jdien07@mac.com Cell Phone: 202-297-8117 http://joedien.com

arnodelorme commented 4 years ago

The problem is that when using Fieldtrip it is not possible to choose which MMF field should be used for Fieldtrip event values and types (which is not the case in EEGLAB). This would solve the problem, but if you think this is not useful, let’s not do it.

Arno

On Jan 13, 2020, at 5:19 PM, jdien07 notifications@github.com wrote:

to be honest, I don’t see how this would address the concern I raised with Arno. The full mffmatlabio output is available in hdr.orig, no?

Joe

On Dec 31, 2019, at 15:24, Arnaud Delorme notifications@github.com wrote:

Discussion by email revealed that Joe uses the Fieldtrip version which does not have the option to import custom MFF fields into as types. The EEGLAB function has a wrapper and a GUI that allow users to choose which field to import for types.

The problem is that the Fieldtrip function does not accept such parameter. What I propose is to change ft_read_event and add a parameter 'typefield' that would then be passed on to the function mff_fileio_read_event. Robert @robertoostenveld https://github.com/robertoostenveld, please approve and I can make the change and submit a pull request to FileIO/Fieldtrip. This is an important deal for users of the MFF format.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/arnodelorme/mffmatlabio/issues/15?email_source=notifications&email_token=AE4T465FND55CAARKNQYCB3Q3OTA3A5CNFSM4I76WCWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH4UV5Y#issuecomment-569985783, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4T46Z6BJS5OVPPRIWS4YTQ3OTA3ANCNFSM4I76WCWA.


Joseph Dien, PhD Senior Research Scientist Department of Human Development and Quantitative Methodology University of Maryland, College Park E-mail: jdien07@mac.com Cell Phone: 202-297-8117 http://joedien.com

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

jdien07 commented 4 years ago

let’s be clear, I’m not really “using" FieldTrip for EP Toolkit. All I’m using is the output of ft_read_header and ft_read_event. Everything past that is my own code. I’m a programmer. The issues I raised with you were regarding the contents of the mffmatlabio output and have nothing to do with FieldTrip per se. That said, I don’t have a working NetStation hasp so it makes it difficult for me to conduct testing. Philips said they were working on getting me an updated demo license, at which point I could say something more useful.

Joe

On Jan 13, 2020, at 18:46, Arnaud Delorme notifications@github.com wrote:

The problem is that when using Fieldtrip it is not possible to choose which MMF field should be used for Fieldtrip event values and types (which is not the case in EEGLAB). This would solve the problem, but if you think this is not useful, let’s not do it.

Arno

On Jan 13, 2020, at 5:19 PM, jdien07 notifications@github.com wrote:

to be honest, I don’t see how this would address the concern I raised with Arno. The full mffmatlabio output is available in hdr.orig, no?

Joe

On Dec 31, 2019, at 15:24, Arnaud Delorme notifications@github.com wrote:

Discussion by email revealed that Joe uses the Fieldtrip version which does not have the option to import custom MFF fields into as types. The EEGLAB function has a wrapper and a GUI that allow users to choose which field to import for types.

The problem is that the Fieldtrip function does not accept such parameter. What I propose is to change ft_read_event and add a parameter 'typefield' that would then be passed on to the function mff_fileio_read_event. Robert @robertoostenveld https://github.com/robertoostenveld, please approve and I can make the change and submit a pull request to FileIO/Fieldtrip. This is an important deal for users of the MFF format.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/arnodelorme/mffmatlabio/issues/15?email_source=notifications&email_token=AE4T465FND55CAARKNQYCB3Q3OTA3A5CNFSM4I76WCWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH4UV5Y#issuecomment-569985783, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4T46Z6BJS5OVPPRIWS4YTQ3OTA3ANCNFSM4I76WCWA.


Joseph Dien, PhD Senior Research Scientist Department of Human Development and Quantitative Methodology University of Maryland, College Park E-mail: jdien07@mac.com Cell Phone: 202-297-8117 http://joedien.com

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/arnodelorme/mffmatlabio/issues/15?email_source=notifications&email_token=AE4T465KOQVKEN3O7LPEDHTQ5T4OFA5CNFSM4I76WCWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI2XJOY#issuecomment-573928635, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4T46YB4QVPO2ALL55EPSDQ5T4OFANCNFSM4I76WCWA.


Joseph Dien, PhD Senior Research Scientist Department of Human Development and Quantitative Methodology University of Maryland, College Park E-mail: jdien07@mac.com Cell Phone: 202-297-8117 http://joedien.com

robertoostenveld commented 4 years ago

... when using Fieldtrip it is not possible to choose which MMF field should be used for Fieldtrip event values

Might this mean that ft_read_event should be improved? As long as it fits into the event structure, i.e. type/value/sample/duration/offset and optionally timestamp, it should work fine. Replicating events (under different "types") is also fine, that is what we also do for other data types.

jdien07 commented 4 years ago

nah, it’s just a matter of the information being provided by mffmatlabio. Nothing to do with FieldTrip.

Joe

On Jan 14, 2020, at 08:06, Robert Oostenveld notifications@github.com wrote:

... when using Fieldtrip it is not possible to choose which MMF field should be used for Fieldtrip event values

Might this mean that ft_read_event should be improved? As long as it fits into the event structure, i.e. type/value/sample/duration/offset and optionally timestamp, it should work fine. Replicating events (under different "types") is also fine, that is what we also do for other data types.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/arnodelorme/mffmatlabio/issues/15?email_source=notifications&email_token=AE4T465ICM36FWL6JBFTO7LQ5W2GVA5CNFSM4I76WCWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI4Q6LA#issuecomment-574164780, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4T465E6OFZ7KHBWPSNQADQ5W2GVANCNFSM4I76WCWA.


Joseph Dien, PhD Senior Research Scientist Department of Human Development and Quantitative Methodology University of Maryland, College Park E-mail: jdien07@mac.com Cell Phone: 202-297-8117 http://joedien.com