Skip to content

Commit 00e705b

Browse files
committed
Removing sidecar jsonlds
1 parent 535c4cc commit 00e705b

9 files changed

+115
-174
lines changed

examples/dcm2niix/README.md

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,37 +54,21 @@ tree sub-02/
5454

5555
## Associated provenance
5656

57-
See the `dcm2niix.prov.jsonld` file that contains all provenance traces relative to the conversion steps.
58-
59-
Two file level provenance files (`.prov.jsonld` sidecars) are also available, representing the provenance of the associated files:
60-
* `sub-02/ses-20130717141500/anat/sub-02_ses-20130717141500_T1w.prov.jsonld`
61-
* `sub-02/ses-20140425155335/func/sub-02_ses-20140425155335_task-oneback_run-1_bold.prov.jsonld`
62-
63-
Note that these files are independant and self-sufficient, although they describe the same provenance traces. To be more specific: `dcm2niix.prov.jsonld` contains all information described by the two sidecar files.
57+
The `prov/dcm2niix.prov.jsonld` file contains all provenance traces relative to the conversion steps.
6458

6559
We are able to visualize these provenance files using the following commands (current directory is `examples/dcm2niix/`):
6660

6761
```shell
62+
pip install -r ../../requirements.txt
6863
python ../../bids_prov/visualize.py --input_file prov/dcm2niix.prov.jsonld --output_file prov/dcm2niix.prov.png
6964
```
7065
![](/examples/dcm2niix/prov/dcm2niix.prov.png)
7166

72-
```shell
73-
python ../../bids_prov/visualize.py --input_file sub_02/ses_20130717141500/anat/sub-02_ses-20130717141500_T1w.prov.jsonld --output_file sub_02/ses_20130717141500/anat/sub-02_ses-20130717141500_T1w.prov.png
74-
```
75-
![](/examples/dcm2niix/sub_02/ses_20130717141500/anat/sub-02_ses-20130717141500_T1w.prov.png)
76-
77-
```shell
78-
python ../../bids_prov/visualize.py --input_file sub_02/ses_20140425155335/func/sub-02_ses-20140425155335_task-oneback_run-1_bold.prov.jsonld --output_file sub_02/ses_20140425155335/func/sub-02_ses-20140425155335_task-oneback_run-1_bold.prov.png
79-
```
80-
![](/examples/dcm2niix/sub_02/ses_20140425155335/func/sub-02_ses-20140425155335_task-oneback_run-1_bold.prov.png)
81-
8267
## Limitations
8368

8469
### Using the JSON-LD playground
8570

86-
These example files can be tested inside the [JSON-LD playground](https://json-ld.org/playground/), although the context IRI must be changed to:
87-
`https://raw.githubusercontent.com/bids-standard/BEP028_BIDSprov/master/context.json`
71+
The `prov/dcm2niix.prov.jsonld` file can be tested inside the [JSON-LD playground](https://json-ld.org/playground/), although the context IRI must be changed to: `https://raw.githubusercontent.com/bids-standard/BEP028_BIDSprov/master/context.json`
8872

8973
### `Used` key for activities
9074

@@ -94,9 +78,20 @@ Although the BIDS-Prov spec mentions:
9478
9579
We represented used entities in a list to link all the dicom files of a directory to the corresponding conversion activity.
9680

81+
### `Environments` not defined in the context
82+
83+
We cannot use an `Environments` list because the current context (commit ce0eb77) does not define the `Environments` term. Therefore, we defined the `urn:fedora-b7hmkmqd` environments as an `Entity`.
84+
9785
### High number of dicom files
9886

99-
As there is a high number of dicom files (384 in `acq1/` and 5460 in `acq2/`), we did not create an entity for each of these. Only the first three files of each directory were represented.
87+
Listing all the DICOM files used by the dcm2niix conversion steps would lower readability of the JSON-LD provenance files. Therefore we only listed the following directories as `Entities`:
88+
89+
```
90+
bids::sourcedata/hirni-demo/acq1/dicoms/example-dicom-structural-master/dicoms
91+
bids::sourcedata/hirni-demo/acq2/dicoms/example-dicom-functional-master/dicoms
92+
```
93+
94+
although it is not allowed by the current version of the BIDS Prov specification to have directories as `Entities`.
10095

10196
### `TaskName` not generated
10297

examples/dcm2niix/prov/dcm2niix.prov.jsonld

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@
22
"@context": "https://purl.org/nidash/bidsprov/context.json",
33
"BIDSProvVersion": "0.0.1",
44
"Records": {
5-
"prov:Entity": [
6-
{
7-
"Id": "urn:fedora",
8-
"Label": "Fedora release 36 (Thirty Six)",
9-
"OperatingSystem": " GNU/Linux 6.2.15-100.fc36.x86_64"
10-
}
11-
],
125
"Software": [
136
{
14-
"Id": "urn:dcm2niix",
7+
"Id": "urn:dcm2niix-xce5m9z3",
158
"Label": "dcm2niix",
169
"Version": "v1.0.20220720"
1710
}
@@ -21,51 +14,31 @@
2114
"Id": "urn:conversion-00f3a18f",
2215
"Label": "Conversion",
2316
"Command": "dcm2niix -o . -f sub-%i/ses-%t/anat/sub-%i_ses-%t_T1w sourcedata/hirni-demo/acq1/dicoms/example-dicom-structural-master/dicoms/",
24-
"AssociatedWith": "urn:dcm2niix",
17+
"AssociatedWith": "urn:dcm2niix-xce5m9z3",
2518
"Used": [
26-
"urn:fedora",
27-
"bids::sourcedata/hirni-demo/acq1/dicoms/example-dicom-structural-master/dicoms/N2D_0001.dcm",
28-
"bids::sourcedata/hirni-demo/acq1/dicoms/example-dicom-structural-master/dicoms/N2D_0002.dcm",
29-
"bids::sourcedata/hirni-demo/acq1/dicoms/example-dicom-structural-master/dicoms/N2D_0003.dcm"
19+
"urn:fedora-b7hmkmqd",
20+
"bids::sourcedata/hirni-demo/acq1/dicoms/example-dicom-structural-master/dicoms"
3021
]
3122
},
3223
{
3324
"Id": "urn:conversion-5a66f5be",
3425
"Label": "Conversion",
3526
"Command": "dcm2niix -o . -f sub-%i/ses-%t/func/sub-%i_ses-%t_task-oneback_run-1_bold sourcedata/hirni-demo/acq2/dicoms/example-dicom-functional-master/dicoms/",
36-
"AssociatedWith": "urn:dcm2niix",
27+
"AssociatedWith": "urn:dcm2niix-xce5m9z3",
3728
"Used": [
38-
"urn:fedora",
39-
"bids::sourcedata/hirni-demo/acq2/dicoms/example-dicom-functional-master/dicoms/MR.1.3.46.670589.11.38317.5.0.4476.2014042516042547586",
40-
"bids::sourcedata/hirni-demo/acq2/dicoms/example-dicom-functional-master/dicoms/MR.1.3.46.670589.11.38317.5.0.4476.2014042516042548588",
41-
"bids::sourcedata/hirni-demo/acq2/dicoms/example-dicom-functional-master/dicoms/MR.1.3.46.670589.11.38317.5.0.4476.2014042516042551590"
29+
"urn:fedora-b7hmkmqd",
30+
"bids::sourcedata/hirni-demo/acq2/dicoms/example-dicom-functional-master/dicoms"
4231
]
4332
}
4433
],
4534
"Entities": [
4635
{
47-
"Id": "bids::sourcedata/hirni-demo/acq1/dicoms/example-dicom-structural-master/dicoms/N2D_0001.dcm",
48-
"Label": "N2D_0001.dcm"
49-
},
50-
{
51-
"Id": "bids::sourcedata/hirni-demo/acq1/dicoms/example-dicom-structural-master/dicoms/N2D_0002.dcm",
52-
"Label": "N2D_0002.dcm"
53-
},
54-
{
55-
"Id": "bids::sourcedata/hirni-demo/acq1/dicoms/example-dicom-structural-master/dicoms/N2D_0003.dcm",
56-
"Label": "N2D_0003.dcm"
36+
"Id": "bids::sourcedata/hirni-demo/acq1/dicoms/example-dicom-structural-master/dicoms",
37+
"Label": "dicoms"
5738
},
5839
{
59-
"Id": "bids::sourcedata/hirni-demo/acq2/dicoms/example-dicom-functional-master/dicoms/MR.1.3.46.670589.11.38317.5.0.4476.2014042516042547586",
60-
"Label": "MR.1.3.46.670589.11.38317.5.0.4476.2014042516042547586"
61-
},
62-
{
63-
"Id": "bids::sourcedata/hirni-demo/acq2/dicoms/example-dicom-functional-master/dicoms/MR.1.3.46.670589.11.38317.5.0.4476.2014042516042548588",
64-
"Label": "MR.1.3.46.670589.11.38317.5.0.4476.2014042516042548588"
65-
},
66-
{
67-
"Id": "bids::sourcedata/hirni-demo/acq2/dicoms/example-dicom-functional-master/dicoms/MR.1.3.46.670589.11.38317.5.0.4476.2014042516042551590",
68-
"Label": "MR.1.3.46.670589.11.38317.5.0.4476.2014042516042551590"
40+
"Id": "bids::sourcedata/hirni-demo/acq2/dicoms/example-dicom-functional-master/dicoms",
41+
"Label": "dicoms"
6942
},
7043
{
7144
"Id": "bids::sub-02/ses-20130717141500/anat/sub-02_ses-20130717141500_T1w.nii",
@@ -86,6 +59,11 @@
8659
"Id": "bids::sub-02/ses-20140425155335/func/sub-02_ses-20140425155335_task-oneback_run-1_bold.json",
8760
"Label": "sub-02_ses-20140425155335_task-oneback_run-1_bold.json",
8861
"GeneratedBy": "urn:conversion-5a66f5be"
62+
},
63+
{
64+
"Id": "urn:fedora-b7hmkmqd",
65+
"Label": "Fedora release 36 (Thirty Six)",
66+
"OperatingSystem": " GNU/Linux 6.2.15-100.fc36.x86_64"
8967
}
9068
]
9169
}
-54.9 KB
Loading
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"Modality": "MR",
3+
"ManufacturersModelName": "nifti2dicom",
4+
"SoftwareVersions": "0.4.11",
5+
"SeriesDescription": "anat-T1w",
6+
"ProtocolName": "anat-T1w",
7+
"ImageType": ["DERIVED", "SECONDARY"],
8+
"RawImage": false,
9+
"SeriesNumber": 401,
10+
"AcquisitionTime": "13:25:18.000000",
11+
"AcquisitionNumber": 1,
12+
"SliceThickness": 0.666667,
13+
"SpacingBetweenSlices": 0.666667,
14+
"ImageOrientationPatientDICOM": [
15+
0.999032,
16+
-0.0217884,
17+
0.0382096,
18+
0.0265195,
19+
0.991414,
20+
-0.128044 ],
21+
"ConversionSoftware": "dcm2niix",
22+
"ConversionSoftwareVersion": "v1.0.20220720"
23+
}

examples/dcm2niix/sub_02/ses_20130717141500/anat/sub-02_ses-20130717141500_T1w.prov.jsonld

Lines changed: 0 additions & 58 deletions
This file was deleted.
Binary file not shown.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"Modality": "MR",
3+
"MagneticFieldStrength": 3,
4+
"ImagingFrequency": 127.753,
5+
"Manufacturer": "Philips",
6+
"ManufacturersModelName": "Achieva dStream",
7+
"PatientPosition": "HFS",
8+
"ProcedureStepDescription": "Transrep2",
9+
"SoftwareVersions": "5.1.1\\5.1.1.0",
10+
"MRAcquisitionType": "2D",
11+
"SeriesDescription": "func_task-oneback_run-1",
12+
"ProtocolName": "func_task-oneback_run-1",
13+
"TaskName": "oneback",
14+
"ScanningSequence": "GR",
15+
"SequenceVariant": "SK",
16+
"ScanOptions": "FS",
17+
"PulseSequenceName": "FEEPI",
18+
"ImageType": ["ORIGINAL", "PRIMARY", "M", "FFE", "M", "FFE"],
19+
"SeriesNumber": 401,
20+
"AcquisitionTime": "16:04:22.680000",
21+
"AcquisitionNumber": 4,
22+
"PhilipsRWVSlope": 4.00757,
23+
"PhilipsRWVIntercept": 0,
24+
"PhilipsRescaleSlope": 4.00757,
25+
"PhilipsRescaleIntercept": 0,
26+
"PhilipsScaleSlope": 0.0132383,
27+
"UsePhilipsFloatNotDisplayScaling": 1,
28+
"SliceThickness": 3,
29+
"SpacingBetweenSlices": 3.3,
30+
"SAR": 0.994626,
31+
"EchoTime": 0.03,
32+
"RepetitionTime": 1.79355,
33+
"RepetitionTimeExcitation": 2,
34+
"MTState": false,
35+
"FlipAngle": 90,
36+
"CoilString": "MULTI COIL",
37+
"PercentPhaseFOV": 100,
38+
"PercentSampling": 100,
39+
"EchoTrainLength": 43,
40+
"PhaseEncodingSteps": 80,
41+
"AcquisitionMatrixPE": 80,
42+
"ReconMatrixPE": 80,
43+
"ParallelReductionFactorInPlane": 2,
44+
"ParallelAcquisitionTechnique": "SENSE",
45+
"WaterFatShift": 12.4991,
46+
"EstimatedEffectiveEchoSpacing": 0.000355975,
47+
"EstimatedTotalReadoutTime": 0.028122,
48+
"AcquisitionDuration": 325.918,
49+
"PixelBandwidth": 1920,
50+
"PhaseEncodingAxis": "j",
51+
"ImageOrientationPatientDICOM": [
52+
0.999805,
53+
-0.0114282,
54+
0.0161145,
55+
0.0147905,
56+
0.973763,
57+
-0.227084 ],
58+
"InPlanePhaseEncodingDirectionDICOM": "COL",
59+
"ConversionSoftware": "dcm2niix",
60+
"ConversionSoftwareVersion": "v1.0.20220720"
61+
}

examples/dcm2niix/sub_02/ses_20140425155335/func/sub-02_ses-20140425155335_task-oneback_run-1_bold.prov.jsonld

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)