bids-standard / BEP028_BIDSprov

Organizing and coordinating BIDS extension proposal 28 : BIDS Provenance
https://bids.neuroimaging.io/bep028
Creative Commons Attribution 4.0 International
4 stars 12 forks source link

Added a mapping for labels to make them more human-readable #84

Closed thomasbtnfr closed 1 year ago

thomasbtnfr commented 1 year ago

A label mapping from a json file has been added. The file is called spm_labels.json and is located in the following directory bids_prov/mapping_labels.

Here is its format:

{
"matlab label part": "new name"
}

For example, we can have the following dictionary:

{
  "coreg": "Coregistration"
}

If we have the following label spm.spatial.coreg.estimate.ref(1), it will be transformed into Coregistration because the key in our dict in contained in `spm.spatial.coreg.estimate.ref(1).

spm.spatial.coreg.estimate.ref(1) -> Coregistration

Application example with the 1st result example: image

cmaumet commented 1 year ago

This is awesome! Thank you @thomasbtnfr. I tried to updated the mapping file to include more labels for SPM but the tests are now failing. Could you help me understand what I did wrong? Thank you!

thomasbtnfr commented 1 year ago

It must come from the internal functioning, you filled in the file correctly. I fix that in the day

thomasbtnfr commented 1 year ago

The problem came from the activity labels. Indeed, I replaced completely the existing label by the mapping but in the global process the "_{activity number}" is actually very important especially for the "used" and "wasGeneratedBy" keys. That's why I added the activity number after the mapping which solves the current problem. At the end of the script I added a post processing to remove this activity number which I think is not interesting for the users.

Now, example of graph: image

cmaumet commented 1 year ago

Great! Thank you!