-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENH] Update config to support microscopy, qMRI, PET, ASL (#840)
* add Pipfile to gitingore * add missing datatypes to config * add microscopy entities to config * add draft path patterns microscopy and qMRI * clean up and refactor * add extension micr * add suffixes micr * add photo files for micr * add parametric parts of qMRI * add PET tracer entity to config * add path patterns for PET * add path patterns for ASL * refactor some patterns * add patterns for json files in root of dataset * update bids nodot config and use {suffix<>} everywhere * add tracer entity to no dot config * fix entity order in filename pattern for no dot config * fix typo * remove problematic path pattern * readd sample entity to micr filename pattern in root of dataset * sample is actually required for micr * update test layout on bids-example * Update bids/layout/config/bids.json Co-authored-by: Chris Markiewicz <[email protected]> * Update bids/layout/config/bids.json Co-authored-by: Chris Markiewicz <[email protected]> * fix separator position for session * add more bids example layout tests and flag MPM as xfail * flag qmri_qsm as failure expected too * make xfail strict to detect tests when they start passing * Update bids/layout/config/bids.json Co-authored-by: mariehbourget <[email protected]> * Update bids/layout/config/bids.json Co-authored-by: mariehbourget <[email protected]> * fix more typos * use bids-example submodule and fixture for testing * remove makefile recipe for bids-examles * MNT: Restore makefile Co-authored-by: Chris Markiewicz <[email protected]> Co-authored-by: mariehbourget <[email protected]> Co-authored-by: Christopher J. Markiewicz <[email protected]>
- Loading branch information
1 parent
c81e7f9
commit 79ee34a
Showing
3 changed files
with
142 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
""" Tests runs layout on bids examples and make sure all files are caught""" | ||
|
||
""" TODO | ||
- add more 'vanilla' datasets | ||
- missing files in micr? | ||
""" | ||
|
||
from os.path import join | ||
|
||
import pytest | ||
|
||
from bids.layout import BIDSLayout | ||
|
||
# Values for the number of file got from a: | ||
# | ||
# find ds_name -type f | wc -l | ||
# | ||
|
||
@pytest.mark.parametrize( | ||
"dataset, nb_files", | ||
[ | ||
("qmri_irt1", 15), | ||
("qmri_mese", 73), | ||
("qmri_mp2rage", 14), | ||
("qmri_mp2rageme", 28), | ||
("qmri_mtsat", 23), | ||
("qmri_sa2rage", 9), | ||
("qmri_vfa", 17), | ||
], | ||
) | ||
def test_layout_on_examples_with_derivatives(dataset, nb_files, bids_examples): | ||
ds = join(bids_examples, dataset) | ||
layout = BIDSLayout(ds, derivatives=True) | ||
files = layout.get() | ||
assert len(files) == nb_files | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"dataset, nb_files", | ||
[ | ||
("micr_SEM", 12), | ||
("micr_SPIM", 22), | ||
("asl001", 8), | ||
("asl002", 10), | ||
("asl003", 10), | ||
("asl004", 12), | ||
("asl005", 10), | ||
("pet001", 12), | ||
("pet002", 20), | ||
("pet003", 9), | ||
("pet004", 10), | ||
("pet005", 14), | ||
("qmri_megre", 18), | ||
("qmri_tb1tfl", 6), | ||
], | ||
) | ||
def test_layout_on_examples_no_derivatives(dataset, nb_files, bids_examples): | ||
ds = join(bids_examples, dataset) | ||
layout = BIDSLayout(ds) | ||
files = layout.get() | ||
assert len(files) == nb_files | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"dataset, nb_files", | ||
[ | ||
pytest.param( | ||
"qmri_qsm", | ||
8, | ||
marks=pytest.mark.xfail(strict=True, | ||
reason="https://github.com/bids-standard/bids-examples/issues/311" | ||
), | ||
), | ||
pytest.param( | ||
"qmri_mpm", | ||
125, | ||
marks=pytest.mark.xfail(strict=True, | ||
reason="https://github.com/bids-standard/bids-examples/issues/310" | ||
), | ||
), | ||
], | ||
) | ||
def test_layout_on_examples_invalid_ds_description(dataset, nb_files, bids_examples): | ||
ds = join(bids_examples, dataset) | ||
layout = BIDSLayout(ds, derivatives=True) | ||
files = layout.get() | ||
assert len(files) == nb_files |