Skip to content

Commit 92d7f9e

Browse files
committed
Replace normalize by flirt
1 parent 6734159 commit 92d7f9e

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

examples/nipype/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ See [hereafter](#running-the-workflow) for more details on how to run the workfl
1616
In order to describe provenance records using BIDS Prov, we use:
1717

1818
* the `GeneratedBy` field of JSON sidecar files, already existing in the BIDS specification;
19-
* modality agnostic files inside the `prov/` directory
19+
* modality agnostic files inside the `derivatives/flirt/prov/` directory
2020
* a modality agnostic file inside the `derivatives/flirt/sub-001/anat/` directory
2121

2222
After running the workflow and adding provenance traces, the resulting directory tree looks like this:
@@ -55,7 +55,7 @@ The python script `code/merge_prov.py` aims at merging all provenance records in
5555

5656
```shell
5757
pip install bids-prov==0.1.0
58-
mkdir prov/merged/
58+
mkdir derivatives/flirt/prov/merged/
5959
python code/merge_prov.py
6060
```
6161

@@ -69,7 +69,7 @@ We are then able to visualize these provenance files using the following command
6969

7070
```shell
7171
pip install bids-prov==0.1.0
72-
bids_prov_visualizer --input_file prov/merged/prov-flirt.prov.jsonld --output_file prov/merged/prov-flirt.prov.png
72+
bids_prov_visualizer --input_file derivatives/flirt/prov/merged/prov-flirt.prov.jsonld --output_file derivatives/flirt/prov/merged/prov-flirt.prov.png
7373
```
7474

7575
![](/examples/nipype/prov/merged/prov-flirt.prov.png)

examples/nipype/code/merge_prov.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88

99
# List of available prov files
1010
prov_soft_files = [
11-
'prov/prov-flirt_soft.prov.json'
11+
'derivatives/flirt/prov/prov-flirt_soft.prov.json'
1212
]
1313
prov_env_files = [
14-
'prov/prov-flirt_env.prov.json'
14+
'derivatives/flirt/prov/prov-flirt_env.prov.json'
1515
]
1616
prov_act_files = [
1717
'derivatives/flirt/sub-001/anat/sub-001_prov-flirt_act.prov.json'
1818
]
1919
prov_ent_files = [
20-
'prov/prov-flirt_ent.prov.json'
20+
'derivatives/flirt/prov/prov-flirt_ent.prov.json'
2121
]
2222
sidecar_files = [
2323
'derivatives/flirt/sub-001/anat/sub-001_T1w_brain.json',
@@ -34,7 +34,7 @@
3434
}
3535

3636
# Add context and version
37-
with open('prov/prov-flirt_base.prov.json', encoding = 'utf-8') as file:
37+
with open('derivatives/flirt/prov/prov-flirt_base.prov.json', encoding = 'utf-8') as file:
3838
base_provenance.update(json.load(file))
3939

4040
# Parse Software
@@ -90,5 +90,5 @@
9090
})
9191

9292
# Write jsonld
93-
with open('prov/merged/prov-flirt.prov.jsonld', 'w', encoding = 'utf-8') as file:
93+
with open('derivatives/flirt/prov/merged/prov-flirt.prov.jsonld', 'w', encoding = 'utf-8') as file:
9494
file.write(json.dumps(base_provenance, indent = 2))

examples/nipype/code/normalize.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
export_brain = Node(ExportFile(), name = 'export_brain')
2727
export_brain.inputs.clobber = True
2828
export_brain.inputs.out_file = abspath(
29-
'derivatives/normalize/sub-001/anat/sub-001_T1w_brain.nii.gz')
29+
'derivatives/flirt/sub-001/anat/sub-001_T1w_brain.nii.gz')
3030
workflow.connect(brain_extraction, 'out_file', export_brain, 'in_file')
3131

32-
export_normalized_brain = Node(ExportFile(), name = 'export_normalized_brain')
33-
export_normalized_brain.inputs.clobber = True
34-
export_normalized_brain.inputs.out_file = abspath(
35-
'derivatives/normalize/sub-001/anat/sub-001_space-mni152nlin2009casym_T1w_brain.nii.gz')
36-
workflow.connect(brain_extraction, 'out_file', export_normalized_brain, 'in_file')
32+
export_brain_MNI_space = Node(ExportFile(), name = 'export_brain_MNI_space')
33+
export_brain_MNI_space.inputs.clobber = True
34+
export_brain_MNI_space.inputs.out_file = abspath(
35+
'derivatives/flirt/sub-001/anat/sub-001_space-mni152nlin2009casym_T1w_brain.nii.gz')
36+
workflow.connect(brain_extraction, 'out_file', export_brain_MNI_space, 'in_file')
3737

3838
# Run workflow
3939
workflow.run()

examples/nipype/derivatives/flirt/prov/merged/prov-flirt.prov.jsonld

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"Id": "bids::prov/#bet-ys913vx4"
3232
},
3333
{
34-
"Label": "normalization",
34+
"Label": "flirt",
3535
"Command": "flirt -in /work/derivatives/bids_prov_workflow/brain_extraction/sub-001_T1w_brain.nii.gz -ref /usr/share/fsl/5.0/data/standard/MNI152_T1_1mm_brain.nii.gz -out sub-001_T1w_brain_flirt.nii.gz -omat sub-001_T1w_brain_flirt.mat",
3636
"AssociatedWith": "bids::prov/#fsl-e1oq534p",
3737
"Used": [
@@ -57,12 +57,12 @@
5757
"Id": "bids::prov/#export_file-i1cblvll"
5858
},
5959
{
60-
"Label": "export_normalized_brain",
60+
"Label": "export_brain_MNI_space",
6161
"Command": "shutil.copy",
6262
"AssociatedWith": "bids::prov/#nipype-s9w94f9u",
6363
"Used": [
6464
{
65-
"Id": "bids::derivatives/bids_prov_workflow/normalization/sub-001_T1w_brain_flirt.nii.gz",
65+
"Id": "bids::derivatives/bids_prov_workflow/flirt/sub-001_T1w_brain_flirt.nii.gz",
6666
"Type": "Entity",
6767
"Label": "sub-001_T1w_brain_flirt.nii.gz",
6868
"GeneratedBy": "bids::prov/#flirt-xzje9hjh"
@@ -83,11 +83,11 @@
8383
"Id": "/usr/share/fsl/5.0/data/standard/MNI152_T1_1mm_brain.nii.gz"
8484
},
8585
{
86-
"Id": "bids::derivatives/normalize/sub-001/anat/sub-001_T1w_brain.nii.gz",
86+
"Id": "bids::derivatives/flirt/sub-001/anat/sub-001_T1w_brain.nii.gz",
8787
"GeneratedBy": "bids::prov/#export_file-i1cblvll"
8888
},
8989
{
90-
"Id": "bids::derivatives/normalize/sub-001/anat/sub-001_space-mni152nlin2009casym_T1w_brain.nii.gz",
90+
"Id": "bids::derivatives/flirt/sub-001/anat/sub-001_space-mni152nlin2009casym_T1w_brain.nii.gz",
9191
"GeneratedBy": "bids::prov/#export_file-fpw3jrwy"
9292
}
9393
]
12.6 KB
Loading

examples/nipype/derivatives/flirt/sub-001/anat/sub-001_prov-flirt_act.prov.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
]
3838
},
3939
"bids::prov/#export_file-fpw3jrwy": {
40-
"Label": "export_normalized_brain",
40+
"Label": "export_brain_MNI_space",
4141
"Command": "shutil.copy",
4242
"AssociatedWith": "bids::prov/#nipype-s9w94f9u",
4343
"Used": [

0 commit comments

Comments
 (0)