Fix how build_path deals with run entity
See original GitHub issueIs there a good reason for “run” to parse as a integer (instead of a string)? It means that layout.build_path does not return something matching the original…
data_path = os.path.join(get_test_data_path(), 'ds005')
layout = BIDSLayout(data_path)
f = layout.get(suffix = 'bold')[1]
rebuilt_path = layout.build_path(f.entities)
assert f.filename == os.path.basename(rebuilt_path)
orig_filename sub-12_task-mixedgamblestask_run-02_bold.nii.gz
recontructed to sub-12_task-mixedgamblestask_run-2_bold.nii.gz
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
fmriprep failing with "Could not build path with entities" error ...
Our user is running fmriprep version 20.2.0 via singularity/docker singularity exec -e \ docker://poldracklab/fmriprep:20.2.0 ...
Read more >eclipse - The project cannot be built until the build path errors ...
Right click on your project (from package explorer) · Got build path -> configure build path · Select the libraries tab · Fix...
Read more >build path not set correctly after importing fr... - JBoss.org
I have noticed that with my multi-module Mavenized Seam 2.1 project, I must always run 'mvn eclipse:eclipse' after I have imported the project ......
Read more >Solve “pkix path building failed” - Packagecloud Blog
The error 'pkix path building failed' is tough to troubleshoot. Use a reliable package repository like Packagecloud that works all the time.
Read more >Tutorial: Get Started with Entity Framework 6 Code First using ...
If you want to create the database in your App_Data folder, you could add AttachDBFilename=|DataDirectory|\ContosoUniversity1.mdf to the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Might be worth entering into the record, I almost always see
run-01
instead ofrun-1
in existing datasets, which, given my sampling pool, means a good chunk of OpenFMRI/OpenNeuro.I suspect many people in practice use OpenNeuro as a model for their BIDS datasets, rather than reading the spec with a pedantic eye, so this practice is bound to spread. I’m not sure that we can really put our foot down here; the spec is permissive if fairly negative: (“In contrast to other labels, run and echo labels MUST be integers. Those labels MAY include zero padding, but this is NOT RECOMMENDED to maintain their uniqueness.”)
I’m not really sure that there is a good pybids solution, but if you’re confident in the naming schemes of your dataset, you can do the following programmatically:
This obviously isn’t going to match a dataset that doesn’t zero-pad. You could get fancy and do a regex to count the number of digits… But then you’re really running into the generality issues that we’ve avoided by refusing to accommodate zero-padding.
Layouts should be fine. IIRC Analysis has the assumption that run is an int baked in pretty heavily.
There seems to be agreement that the solution is for users to either rename their files or use one of the above workarounds, so I’m closing this.