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

BUG (?) - scans.tsv backslash path #1408

Closed
richardkoehler opened this issue Jan 28, 2022 · 4 comments · Fixed by bids-standard/bids-specification#867
Closed

BUG (?) - scans.tsv backslash path #1408

richardkoehler opened this issue Jan 28, 2022 · 4 comments · Fixed by bids-standard/bids-specification#867

Comments

@richardkoehler
Copy link

Dear all,

I write my BIDS datasets with FieldTrip's data2bids function.
This function writes out filenames in scans.tsv with a backslash, e.g.:

ieeg\sub-009_ses-EcogLfpMedOff01_task-SelfpacedRotationR_acq-StimOff01_run-01_ieeg.vhdr

The bids validator gives the following error:

[ERR] The filename in scans.tsv file does not match what is present in the BIDS dataset. (code: 129 - SCANS_FILENAME_NOT_MATCH_DATASET)

I don't know enough about path styles and back and forward slashes, but my feeling is that file path separators are system-dependent, bids-validator should work in both cases and optimally convert the slash to the system-specific separator when checking if the file actually exists.
I am not sure if this makes sense or is even possible, but I am happy to hear your opinions and I am happy to contribute to the code if necessary :)

Thanks in advance!

@sappelhoff
Copy link
Member

related: bids-standard/bids-specification#867 which was brought up here: bids-standard/bids-specification#820 (comment)

If I understood it correctly, Windows can actually deal with both / and \ as path separators, whereas unix systems only accept / (maybe https://stackoverflow.com/q/1589930/5201771 ?) --> therefore, all BIDS path separators should be (MUST, actually) forward slashes /.

It's relatively straight forward for tools to make this easy for users, so we just need to make this clearer everywhere (and find consensus, if this is actually controversial)

@richardkoehler
Copy link
Author

Okay, that's actually great news, and pretty much answers my question.
I hope your PR will make it to the next bids-specification then and I will make a PR to fieldtrip to handle this issue.
Thanks again!

@sappelhoff
Copy link
Member

Buuut, I am not entirely sure about this comment of mine:

If I understood it correctly, Windows can actually deal with both / and \ as path separators, whereas unix systems only accept /

Maybe some Windows users can chime in? @VisLab for example? Or you can test it on your machine?

@richardkoehler
Copy link
Author

So, since I am pretty inexperienced with this kind of stuff, I am not sure if I need to test this in a specific piece of code, but the following cases work:

  • Using both back and forward slashes works in my windows command prompt or terminal
  • Replacing the back slash by a forward slash in the scans.tsv resolves the problem with the bids-validator, so forward slash seems to work fine on windows here

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 a pull request may close this issue.

2 participants