Comments (5)
Well it is not the expected behaviour. I think that one of the items on the to do list has been trying to make sure that the BIDS inheritance principle is properly implemented but we have gotten there yet.
from bids-matlab.
Yes, a valid implementation of the inheritance principle still requires some work. The commented out tests were created here:
#10
Note that, at least until recently, the inheritance principle was not entirely clearly defined (especially its granularity) so it might be worth checking its status.
from bids-matlab.
I may be able to help with this.
It looks like bids.query
, when you don't pass a 'sub','01'
query filter, filters to "all subjects" and still goes down to the subject level when searching for metadata. And that subject-level metadata overrides the top-level metadata.
When there's no 'sub'
filter, should query
be looking at just the top-level metadata? Or still be pulling in metadata from all subjects? Or is this something I should be referring to the BIDS standard documentation for?
from bids-matlab.
I would tend to say that in terms of behavior we should maybe align on what pybids does.
I think that here part our problem is that the way the metadata is collected by get_metadata
, because from my understanding it does the opposite of what we want: it starts by the lowest level in the hierarchy and then goes up level after level and overrides the metadata by what ever it finds on the way.
Am I wrong about this?
from bids-matlab.
I think the get_metadata
implementation is doing the Inheritance principle correctly already. It does start at the lowest level, and then moves up to higher levels, using update_metadata
to add the higher-level metadata. But the key is this line, down in update_metadata
:
if ~isfield(s1,fn{i})
s1.(fn{i}) = s2.(fn{i});
end
That ~isfield
means that the new (upper-level) metadata is only applied if no lower-level metadata source had already set it for that key. So lower-level metadata specifications override higher-level metadata on a per-key basis.
I think the issue with the commented-out tests is that the test code is acting like bids.query(BIDS, 'metadata')
will directly get the higher-level metadata, when it actually goes and gets bottom-level per-subject/session metadata. If you want query
to be able to directly get the higher-level metadata, it will need a special calling form for that.
I'll have a look at what pybids does here.
from bids-matlab.
Related Issues (20)
- [ENH]: Incorporate json manipulation into bids.File class HOT 1
- improve error message when folder to index does not exist
- tsvwrite writes non-compliant tsvs when a table is provided HOT 1
- tsvwrite does not write datetimes in bids-compliant format
- TODO: check if tsvwrite can handle datetime data HOT 2
- improve bids.schema API HOT 1
- Test that bids model with nodes and edges in the wrong order
- inheritance principle bug: no more than one file per level allowed
- improve performance
- Resolve bids URI to full path when indexing explicit dependencies
- [ENH]: Retrieval of modality by bids.File HOT 3
- Update documentation
- [MAINT] last release was not published on zenodo HOT 1
- check if there is a way to speed up download of demo datasets
- do not throw warning when derivatives datasets are missing a participants.tsv
- [ENH]: `file.rename` could change `.` to `pt` in the case of `spec.entities.xxx = num2str(1.5)` HOT 1
- [BUG] bids.init adds a participant id with a duplicated sub entity prefix HOT 3
- [BUG] bids.init generated sessions file missing ses label from session_id column HOT 4
- rely on variable-transform spec for tests of transformers
- BIDSModel warnings are not printed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bids-matlab.