diff --git a/datalad_neuroimaging/extractors/bids.py b/datalad_neuroimaging/extractors/bids.py index 622abeb..c0a5ee4 100644 --- a/datalad_neuroimaging/extractors/bids.py +++ b/datalad_neuroimaging/extractors/bids.py @@ -68,14 +68,12 @@ def get_metadata(self, dataset, content): if not exists(opj(self.ds.path, self._dsdescr_fname)): return {}, [] - bids = BIDSLayout( - self.ds.path, - config=[ - 'bids', ( - 'derivatives', - 'derivatives' if exists(opj(self.ds.path, 'derivatives')) else curdir - )], - ) + paths = [(self.ds.path, 'bids')] + derivs_path = opj(self.ds.path, 'derivatives') + if exists(opj(self.ds.path, 'derivatives')): + paths.append((derivs_dir, ['bids', 'derivatives'])) + + bids = BIDSLayout(paths) dsmeta = self._get_dsmeta(bids) if not content: diff --git a/datalad_neuroimaging/extractors/tests/test_bids.py b/datalad_neuroimaging/extractors/tests/test_bids.py index 64f8243..e3e2ed1 100644 --- a/datalad_neuroimaging/extractors/tests/test_bids.py +++ b/datalad_neuroimaging/extractors/tests/test_bids.py @@ -96,6 +96,7 @@ def test_get_metadata(path): @with_tree(tree={'dataset_description.json': """ { "Name": "test", + "BIDSVersion": "1.0.0-rc3", "Description": "Some description" } """, @@ -113,7 +114,8 @@ def test_get_metadata_with_description_and_README(path): dump, """\ { - "conformsto": "http://bids.neuroimaging.io", + "BIDSVersion": "1.0.0-rc3", + "conformsto": "http://bids.neuroimaging.io/bids_spec1.0.0-rc3.pdf", "description": "Some description", "name": "test" }""") @@ -123,7 +125,8 @@ def test_get_metadata_with_description_and_README(path): # https://github.com/datalad/datalad/issues/1138 @with_tree(tree={'dataset_description.json': """ { - "Name": "test" + "Name": "test", + "BIDSVersion": "1.0.0-rc3" } """, 'README': u""" @@ -139,7 +142,8 @@ def test_get_metadata_with_README(path): dump, u"""\ { - "conformsto": "http://bids.neuroimaging.io", + "BIDSVersion": "1.0.0-rc3", + "conformsto": "http://bids.neuroimaging.io/bids_spec1.0.0-rc3.pdf", "description": "A very detailed\\ndescription с юникодом", "name": "test" }""") diff --git a/setup.py b/setup.py index 4758d4c..862dee5 100755 --- a/setup.py +++ b/setup.py @@ -62,7 +62,7 @@ def findsome(subdir, extensions): 'datalad[full]>=0.10.0.rc1', #'datalad-webapp', 'pydicom', # DICOM metadata - 'pybids[analysis]>=0.5.1', # BIDS metadata + 'pybids>=0.6.4', # BIDS metadata 'nibabel', # NIfTI metadata 'pandas', # bids2scidata export ],