Skip to content
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

[WIP] Add bids converter #4128

Closed
wants to merge 4 commits into from
Closed

Conversation

jasmainak
Copy link
Member

@jasmainak jasmainak commented Mar 30, 2017

closes #4127

The BIDS specification can be found here

The BIDS compatible MNE sample data can be found here. Let's see how much of this we can automate.

cc @choldgraf @teonbrooks @dengemann

@codecov-io
Copy link

Codecov Report

Merging #4128 into master will decrease coverage by 1.87%.
The diff coverage is 21.05%.

@@            Coverage Diff             @@
##           master    #4128      +/-   ##
==========================================
- Coverage   86.05%   84.17%   -1.88%     
==========================================
  Files         354      355       +1     
  Lines       63734    63772      +38     
  Branches     9709     9711       +2     
==========================================
- Hits        54847    53683    -1164     
- Misses       6216     7380    +1164     
- Partials     2671     2709      +38

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0130bf9...532b471. Read the comment docs.

@choldgraf
Copy link
Contributor

maybe we should put this in mne.io? are you here today so we can chat?

@teonbrooks
Copy link
Member

interested in this as well, let me know when you meet

@dengemann
Copy link
Member

Funny PR that just adds code without calling it :)

@choldgraf
Copy link
Contributor

choldgraf commented Apr 6, 2017 via email

@dengemann
Copy link
Member

dengemann commented Apr 6, 2017 via email

@choldgraf
Copy link
Contributor

I think some folks are still out of town etc, but I believe @jasmainak was going to iterate on this per the conversations we had at the sprint!

@jasmainak
Copy link
Member Author

@dengemann you will see me next week. Perhaps a good opportunity to push for this ;)

@dengemann
Copy link
Member

dengemann commented Apr 6, 2017 via email

@jasmainak jasmainak force-pushed the bids_converter branch 2 times, most recently from 07db06c to 53bc8c4 Compare April 22, 2017 22:06
@jasmainak
Copy link
Member Author

I added a tiny example. Perhaps I could do with a round of reviews and words of encouragement to help me finish this PR ;)

@dengemann
Copy link
Member

dengemann commented Apr 22, 2017 via email


fnames = dict(events='sample_audvis_raw-eve.fif',
raw='sample_audvis_raw.fif')

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be good to have a little more explanation about what kind of folder structure BIDS follows. Maybe we could add in some RST that gave a rough idea of what this folder structure would be, something w/ this structure:

root/
    anat/
    meg/
        file1.fif

etc

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah maybe eventually. For now, I'll try to provide a link to the BIDS draft ...


input_path = op.join(data_path, 'MEG', 'sample')
output_path = op.join(data_path, '..', 'MNE-sample-data-bids')
folder_to_bids(input_path=input_path, output_path=output_path,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some minimal amount of information that each file must have, that is not absolutely required from MNE?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, there is. You have required fields and you have optional fields. There has to be way to indicate to the user that these required fields are incomplete even after the automatic conversion


input_path = op.join(data_path, 'MEG', 'sample')
output_path = op.join(data_path, '..', 'MNE-sample-data-bids')
folder_to_bids(input_path=input_path, output_path=output_path,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about metadata for time etc? Does it only pull this from a trigger channel? What if we added in support for an events array along with event_id, and it could build an events TSV file from this if it existed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metadata for time comes from raw.info. For the events, I'm reading it from an events file for now. Didn't want to do too much guessing about trigger channel etc. ...

@agramfort
Copy link
Member

@jasmainak I would create a mne-bids repo in mne-tools to quickly make progress. Working in the mne-python code base will be more difficult.

wdyt?

@choldgraf
Copy link
Contributor

@agramfort that's an interesting idea. What can we imagine would go in there other than just this PR? Maybe a place to host the MNE-BIDS data? I agree this might be a good offshoot project for now, just trying to envision what it'd look like.

@agramfort
Copy link
Member

agramfort commented Apr 23, 2017 via email

@jasmainak
Copy link
Member Author

jasmainak commented Apr 23, 2017

yeah I agree. Let's make a mne-bids repo. @agramfort can you create it and give me access?

I think apart from the MNE sample data, I'd like to see how much of the conversion for the openfmri data we can easily automate. I feel that with bids a lot of the metadata is already available in fif files. Then perhaps presenting the user with what information is missing so they can fill it manually.

@agramfort
Copy link
Member

agramfort commented Apr 23, 2017 via email

@choldgraf
Copy link
Contributor

sounds good to me - I'm working on a BIDS-iEEG draft w/ some colleagues as well, so I can push some of our sample data there too perhaps!

@jasmainak
Copy link
Member Author

cool, I added what's in this PR to the repo. Let's iterate from there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BIDS I/O Functionality
6 participants