question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect metadata may be returned in non-compliant datasets that have two valid sidecars for a single target in the same directory

See original GitHub issue

pybids version: 0.9.4

I have corresponding jsons and niftis in a BIDS folder from heudiconv, but nifti.get_metadata often returns a value that is the opposite of what the json contains.

In [54]: json.get_dict()['PhaseEncodingDirection']                    
Out[54]: 'j'                                                               
                                           
In [55]: nii.get_metadata()['PhaseEncodingDirection']
Out[55]: 'j-'

I know this was a problem discussed in https://github.com/bids-standard/pybids/issues/40 but there are not much information about what was the problem and how it was fixed. The fact that the whole BIDS folder get scanned at the beginning and is mashed up in SQLAlchemy, which is very obscure for me, makes it very difficult to debug.

Is there a simple explanation of how things are loaded in pybids from jsons/filenames… ? What takes precedence? And how this kind of gross mismatch can occur?

Many BIDS-Apps rely on pybids to load parameters for preprocessing, and this could cause huge problems.

Thanks a lot.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:15

github_iconTop GitHub Comments

0reactions
tyarkonicommented, Oct 29, 2019

I meant directory. If a given file has 5 defined entities, then the natural place to look for a sidecar first is a JSON file that has exactly the same name other than the extension (i.e., it shares the same 5 entities). But if the exact matching sidecar is missing, and there’s another valid JSON file that shares 4 of the same defined entities (and values) as the target file (and has no unique ones itself), then the assumption is that that’s the sidecar to use for the target. What the rule precludes is having multiple sidecar files in the same directory whose entities either perfectly match the target file’s entities, or form a strict subset.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pybids/layout.py at master · bids-standard ...
'dir': return a list of directories. 'id': return a list of unique IDs. Must be used together. with a valid target.
Read more >
bids.layout.layout — PyBIDS 0.15.5 documentation
If True, all pipelines found in the derivatives/ subdirectory will be indexed. If a str or list, gives the paths to one or...
Read more >
309058 – Database can't be synchronized with XMP sidecars
The database only has one copy of the tag tree, in the correct new location. The xmp file has two copies, in the...
Read more >
NEWS
If set to no, result features which would have lower dim geoms are skipped if operating on two layers with same geom dim....
Read more >
the of and to a in for is on s that by this with i you it not
... as your all have new more an was we will home can us about if page my has no search free but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found