Skip to content

Micromed TRC file reader  #10524

Open
Open

Description

@jungju69

Hello,
I have several datasets based on micromed eeg files (scalp EEG, SEEG, ERP).
Do you think it could be possible to develop file readers for that format (TRC files), quite commonly used ?
thank you again for your nice software !

Activity

  1. welcome commented on Apr 13, 2022

    @welcome

    Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽‍♂️

  2. agramfort commented on Apr 13, 2022

    @agramfort
    SponsorMember

    see this old discussion #1605

    @jungju69 would you up for writing such a reader?

  3. jungju69 commented on Apr 13, 2022

    @jungju69
    Author
  4. agramfort commented on Apr 13, 2022

    @agramfort
    SponsorMember
  5. sappelhoff commented on Sep 1, 2022

    @sappelhoff
    Member

    or you could find a documentation of micromed's .trc file format and post it here, maybe someone in the future will implement this.

  6. Daniel-Lachner-Piza commented on Oct 17, 2023

    @Daniel-Lachner-Piza

    see this old discussion #1605

    @jungju69 would you up for writing such a reader?

    Hello MNE community,

    I also work with Micromed files from time to time. I wrote a reader that uses python3 and numpy, it is based on the fieldtrip Micromed reader.

    I'm not sure how you can integrate this reader into the MNE infrastructure, I could send you the script if this helps.

    Done:

    • I compared the read data with the MATLAB reader and it's running fine.
    • I can plot the individual channels using matplotlib and this is also running fine.
    • I created an MNE Raw Array and this also works

    ToDo:

    • The mne.io.RawArray.plot() is not working for some reason. I don't know if I need to define something else when creating the RawArray from scratch.
  7. larsoner commented on Oct 17, 2023

    @larsoner
    Member

    I also work with Micromed files from time to time. I wrote a reader that uses python3 and numpy, it is based on the fieldtrip Micromed reader.

    Unfortunately as far as I understand it FieldTrip is GPL licensed and you cannot use a GPL implementation (FieldTrip) as a reference when adding an implementation to a BSD package (MNE-Python). You'd have to ask permission from the FieldTrip folks to relicence as BSD.

    But if you manage to do that, it does sound like you're close to having a workable solution that we could add!

  8. Daniel-Lachner-Piza commented on Oct 17, 2023

    @Daniel-Lachner-Piza

    My reader is based on the fieldtrip reader in the sense that I used it to know how the data bytes are organized in the TRC files. The reader itself is quite simple and just goes through the file byte by byte sorting the data. I have no experience with Licensing but I would think that it is too simple for there to be any risk of Licensing infringement.

  9. drammock commented on Oct 17, 2023

    @drammock
    Member

    I have no experience with Licensing but I would think that it is too simple for there to be any risk of Licensing infringement.

    Translations of code from one language to another are specifically mentioned in the GPL. https://www.gnu.org/licenses/gpl-faq.html#TranslateCode

    @robertoostenveld one of our users has translated the FieldTrip MicroMed file reader code into Python and is proposing to add it to MNE-Python. Requesting permission to re-license as BSD 3-clause.

  10. robertoostenveld commented on Oct 20, 2023

    @robertoostenveld
    Contributor

    I don't personally hold the copyright over the https://github.com/fieldtrip/fieldtrip/blob/master/fileio/private/read_micromed_trc.m code. It was given to me by researchers in Utrecht (their first names are mentioned in the code, I suspect https://www.umcutrecht.nl/en/research/researchers/van-steensel-mj is the original author - I could not find her on GitHub) and I suspect that they don't care too much how and where it gets reused.

    Using the original implementation to learn the file structure and byte order and using that to make a Python implementation would IMHO not constitute a translation. Asking ChatGPT to make a matlab-to-python translation would be. But if your code looks sufficiently dissimilar to that included in FieldTrip, I won't complain.

    However, why not use the Neo implementation here? That is in Python and BSD licensed already. Or use that to learn how the file structure is, and then write your own. Nobody will be able to tell it apart from the version that you could have written based on the FieldTrip MATLAB code 😉.

  11. larsoner commented on Oct 20, 2023

    @larsoner
    Member

    +1 for using Neo if it has what we want, we are doing something similar for Neuralynx data in #11969 which could be followed as a template

  12. drammock commented on Oct 20, 2023

    @drammock
    Member

    thanks @robertoostenveld for the info and suggestions.

  13. Daniel-Lachner-Piza commented on Oct 24, 2023

    @Daniel-Lachner-Piza

    Thank you @robertoostenveld for your suggestion, the micromed reader from Neo (this one) extracts more information from the files than the fieldtrip reader. It was actually helpful for my project to participate in this topic, I can extract the EEG date and time from the micromed files now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions