Skip to content

Commit

Permalink
Merge pull request #402 from Remi-Gau/res_in_derivative
Browse files Browse the repository at this point in the history
[FIX] Add resolution metadata in derivative
  • Loading branch information
effigies authored Aug 31, 2023
2 parents be35808 + daded14 commit 1c30c6e
Show file tree
Hide file tree
Showing 33 changed files with 83 additions and 36 deletions.
15 changes: 15 additions & 0 deletions ds000001-fmriprep/code/update_res_in_json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Add resolution metadata if json filename contains the res entity."""
import json
from pathlib import Path
from rich import print

root = Path(__file__).parent.parent

files_to_update = root.glob("sub-*/*/sub*res-2*.json")

for event in files_to_update:
with open(event) as f:
metadata = json.load(f)
metadata["Resolution"] = "2mm, isotropic"
with open(event, "w") as f:
json.dump(metadata, f, indent=2)
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"RawSources": "tpl-MNI152NLin2009cAsym/tpl-MNI152NLin2009cAsym_res-02_desc-brain_mask.nii.gz",
"Type": "Brain"
"Type": "Brain",
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"SkullStripped": true
}
"SkullStripped": true,
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RawSources": [
"sub-10/func/sub-10_task-balloonanalogrisktask_run-01_bold.nii.gz"
]
],
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RepetitionTime": 2.0,
"SkullStripped": false,
"TaskName": "balloon analog risk task"
"TaskName": "balloon analog risk task",
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RawSources": [
"sub-10/func/sub-10_task-balloonanalogrisktask_run-02_bold.nii.gz"
]
],
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RepetitionTime": 2.0,
"SkullStripped": false,
"TaskName": "balloon analog risk task"
"TaskName": "balloon analog risk task",
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RawSources": [
"sub-10/func/sub-10_task-balloonanalogrisktask_run-03_bold.nii.gz"
]
],
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RepetitionTime": 2.0,
"SkullStripped": false,
"TaskName": "balloon analog risk task"
"TaskName": "balloon analog risk task",
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"RawSources": "tpl-MNI152NLin2009cAsym/tpl-MNI152NLin2009cAsym_res-02_desc-brain_mask.nii.gz",
"Type": "Brain"
"Type": "Brain",
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"SkullStripped": true
}
"SkullStripped": true,
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RawSources": [
"sub-11/func/sub-11_task-balloonanalogrisktask_run-01_bold.nii.gz"
]
],
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RepetitionTime": 2.0,
"SkullStripped": false,
"TaskName": "balloon analog risk task"
"TaskName": "balloon analog risk task",
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RawSources": [
"sub-11/func/sub-11_task-balloonanalogrisktask_run-02_bold.nii.gz"
]
],
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RepetitionTime": 2.0,
"SkullStripped": false,
"TaskName": "balloon analog risk task"
"TaskName": "balloon analog risk task",
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RawSources": [
"sub-11/func/sub-11_task-balloonanalogrisktask_run-03_bold.nii.gz"
]
],
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RepetitionTime": 2.0,
"SkullStripped": false,
"TaskName": "balloon analog risk task"
"TaskName": "balloon analog risk task",
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"RawSources": "tpl-MNI152NLin2009cAsym/tpl-MNI152NLin2009cAsym_res-02_desc-brain_mask.nii.gz",
"Type": "Brain"
"Type": "Brain",
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"SkullStripped": true
}
"SkullStripped": true,
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RawSources": [
"sub-13/func/sub-13_task-balloonanalogrisktask_run-01_bold.nii.gz"
]
],
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RepetitionTime": 2.0,
"SkullStripped": false,
"TaskName": "balloon analog risk task"
"TaskName": "balloon analog risk task",
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RawSources": [
"sub-13/func/sub-13_task-balloonanalogrisktask_run-02_bold.nii.gz"
]
],
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RepetitionTime": 2.0,
"SkullStripped": false,
"TaskName": "balloon analog risk task"
"TaskName": "balloon analog risk task",
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RawSources": [
"sub-13/func/sub-13_task-balloonanalogrisktask_run-03_bold.nii.gz"
]
],
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RepetitionTime": 2.0,
"SkullStripped": false,
"TaskName": "balloon analog risk task"
"TaskName": "balloon analog risk task",
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"RawSources": "tpl-MNI152NLin2009cAsym/tpl-MNI152NLin2009cAsym_res-02_desc-brain_mask.nii.gz",
"Type": "Brain"
"Type": "Brain",
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"SkullStripped": true
}
"SkullStripped": true,
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RawSources": [
"sub-16/func/sub-16_task-balloonanalogrisktask_run-01_bold.nii.gz"
]
],
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RepetitionTime": 2.0,
"SkullStripped": false,
"TaskName": "balloon analog risk task"
"TaskName": "balloon analog risk task",
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RawSources": [
"sub-16/func/sub-16_task-balloonanalogrisktask_run-02_bold.nii.gz"
]
],
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RepetitionTime": 2.0,
"SkullStripped": false,
"TaskName": "balloon analog risk task"
"TaskName": "balloon analog risk task",
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RawSources": [
"sub-16/func/sub-16_task-balloonanalogrisktask_run-03_bold.nii.gz"
]
],
"Resolution": "2mm, isotropic"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"RepetitionTime": 2.0,
"SkullStripped": false,
"TaskName": "balloon analog risk task"
"TaskName": "balloon analog risk task",
"Resolution": "2mm, isotropic"
}

0 comments on commit 1c30c6e

Please sign in to comment.