Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Error finding meta-data with hierarchy rule #28

Open
adelavega opened this issue Dec 15, 2022 · 3 comments
Open

Error finding meta-data with hierarchy rule #28

adelavega opened this issue Dec 15, 2022 · 3 comments
Labels
ancp bug Something isn't working

Comments

@adelavega
Copy link
Collaborator

In test test_get_tr

The following occurs:

E           KeyError: "Metadata term 'RepetitionTime' unavailable for file /home/zorro/repos/pybids/bids/tests/data/7t_trt/sub-01/ses-1/func/sub-01_ses-1_task-rest_acq-prefrontal_bold.nii.gz."

The meta-data for this file is at the bids root under: task-rest_acq-prefrontal_bold.json.

@erdalkaraca any insight?

@adelavega
Copy link
Collaborator Author

adelavega commented Dec 15, 2022

dataset = load_dataset('bids/tests/data/7t_trt/')
result = query(dataset, 'object', suffix='bold', subject='01')
result[0].get_metadata()
>> {}

The file that fails has the following entities:

{'sub': '01', 'ses': '2', 'task': 'rest', 'acq': 'prefrontal'}

Whereas acq = fullbrain does return meta-data.

The difference being there is a single meta-data file for both run 1 and 2 in the fullbrain scenario.

@adelavega adelavega added bug Something isn't working ancp labels Dec 15, 2022
@erdalkaraca
Copy link
Collaborator

erdalkaraca commented Dec 16, 2022

I think the BIDSMetadata should wrap the metadata returned by its _artifact:

    def get_metadata(self):
        """Return all metadata associated with the current file. """
        md_file = BIDSMetadata(self.path)
        md = self._artifact.get_metadata(include_entities=True)
        md_file.update(md)
        return md_file

@adelavega
Copy link
Collaborator Author

I don't think that's the issue here, it seems like a bug with how ancpbids is implementing the inheritance principle.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ancp bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants