diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index 23e342030..34f640f69 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -139,6 +139,10 @@ jobs: exit 1; fi + - name: Skip legacy validation for post-legacy datasets + run: for DS in mrs_* dwi_deriv pet006 pheno004 volume_timing provenance_*; do touch $DS/.SKIP_VALIDATION; done + if: matrix.bids-validator == 'legacy' + - name: Skip stable validation for datasets with unreleased validator features # Replace ${EMPTY} with dataset patterns, when this is needed # Reset to "for DS in ${EMPTY}; ..." after a validator release @@ -148,7 +152,7 @@ jobs: - name: Skip main validation for datasets with unreleased spec features # Replace ${EMPTY} with dataset patterns, when this is needed # Reset to "for DS in ${EMPTY}; ..." after a spec release - run: for DS in eyetracking_* atlas-* emg_*; do touch $DS/.SKIP_VALIDATION; done + run: for DS in dwi_deriv pheno004 provenance_* eyetracking_* atlas-* emg_*; do touch $DS/.SKIP_VALIDATION; done if: matrix.bids-validator != 'dev' - name: Set BIDS_SCHEMA variable for dev version @@ -157,7 +161,7 @@ jobs: # Update this URL to the schema.json from PRs to the spec, when needed. # If this variable is unset, dev will generally track the latest development # release of https://jsr.io/@bids/schema - run: echo BIDS_SCHEMA=https://bids-specification.readthedocs.io/en/latest/schema.json >> $GITHUB_ENV + run: echo BIDS_SCHEMA=https://bids-specification--2099.org.readthedocs.build/en/2099/schema.json >> $GITHUB_ENV - name: Set BIDS_SCHEMA variable for dev-prs version if: matrix.bids-validator == 'dev-prs' && env.SPEC_PR != '' diff --git a/README.md b/README.md index da0f6e2ba..9abb8fc1b 100644 --- a/README.md +++ b/README.md @@ -391,5 +391,6 @@ TABLE BELOW IS GENERATED AUTOMATICALLY. DO NOT EDIT DIRECTLY. --> -| name | description | datatypes | suffixes | link to full data | maintained by | -|--------|---------------|-------------|------------|---------------------|-----------------| +| name | description | datatypes | suffixes | link to full data | maintained by | +|:------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------|:------------|:-------------------------|:-------------------------------------------------------------------------------------------------|:---------------------------------------| +| [provenance_dcm2niix](https://github.com/bids-standard/bids-examples/tree/master/provenance_dcm2niix) | Shows minimal example of provenance metadata for a DICOM to Nifti conversion with [`dcm2niix`](https://github.com/rordenlab/dcm2niix) | anat | T1w, act, ent, env, soft | This example is based upon [hirni-demo](https://github.com/psychoinformatics-de/hirni-demo) data | [@bclenet](https://github.com/bclenet) | diff --git a/dataset_listing.tsv b/dataset_listing.tsv index ddc8a7e84..3b791e77d 100644 --- a/dataset_listing.tsv +++ b/dataset_listing.tsv @@ -94,3 +94,4 @@ emg_MultiBodyParts EMG recording from multiple body parts with different electro emg_TwoHDsEMG High-density EMG grid recordings from two body parts demonstrating grid placement documentation n/a [@neuromechanist](https://github.com/neuromechanist) emg channels, electrodes, coordsystem, emg emg_TwoWristbands EMG recordings using two wristbands with dry electrodes to capture forearm muscle activity n/a [@neuromechanist](https://github.com/neuromechanist) emg channels, electrodes, coordsystem, emg mri_chunk Example MRI dataset to illustrate BIDS chunk entity. A single subject, two chunks. [@valosekj](https://github.com/valosekj) anat T1w +provenance_dcm2niix Shows minimal example of provenance metadata for a DICOM to Nifti conversion with [`dcm2niix`](https://github.com/rordenlab/dcm2niix) This example is based upon [hirni-demo](https://github.com/psychoinformatics-de/hirni-demo) data [@bclenet](https://github.com/bclenet) anat T1w, act, ent, env, soft \ No newline at end of file diff --git a/provenance_dcm2niix/README.md b/provenance_dcm2niix/README.md new file mode 100644 index 000000000..38abcfede --- /dev/null +++ b/provenance_dcm2niix/README.md @@ -0,0 +1,45 @@ +# Provenance of DICOM to NIfTI conversion with `dcm2niix` + +## Goal + +This example aims at showing provenance metadata for a DICOM to NIfTI conversion with [`dcm2niix`](https://github.com/rordenlab/dcm2niix +). Provenance metadata was created manually ; its acts as a guideline for further machine-generated provenance by `dcm2niix`. + +## Source data + +That the `sourcedata/` directory contains the source dataset (DICOM files) known as [hirni-demo](https://github.com/psychoinformatics-de/hirni-demo). + +## Directory tree + +After conversion, and adding provenance traces, the directory tree is as follows. + +Legend: +* files with a ⭐ were generated by `dcm2niix`; +* files marked with a ✍️ were generated manually; +* files marked with a πŸ€– were computed from the manually generated provenance metadata; +* the ⭐✍️ marked `sub-02/anat/sub-02_T1w.json` file was generated by `dcm2niix`, then the `GeneratedBy` and `SidecarGeneratedBy` provenance-related fields were added manually. + +> [!NOTE] +> Note that the `docs/` directory contains explanatory data (see [Provenance as a RDF graph](#provenance-as-a-rdf-graph)) that is not required to encode provenance. + +``` +✍️ docs/ +β”œβ”€β”€ πŸ€– prov-dcm2niix.jsonld +└── πŸ€– prov-dcm2niix.png +✍️ prov/ +β”œβ”€β”€ ✍️ prov-dcm2niix_act.json +β”œβ”€β”€ ✍️ prov-dcm2niix_ent.json +β”œβ”€β”€ ✍️ prov-dcm2niix_env.json +└── ✍️ prov-dcm2niix_soft.json +sourcedata/ +⭐ sub-02/ +└── ⭐ anat + β”œβ”€β”€ ⭐✍️ sub-02_T1w.json + └── ⭐ sub-02_T1w.nii +``` + +## Provenance as a RDF graph + +Provenance metadata can be aggregated as a JSON-LD RDF graph, which is available in [`docs/prov-dcm2niix.jsonld`](docs/prov-dcm2niix.jsonld). This is a rendered version of the graph, also available in [`docs/prov-dcm2niix.png`](docs/prov-dcm2niix.png). + +![Rendered version of the RDF graph](docs/prov-dcm2niix.png) diff --git a/provenance_dcm2niix/dataset_description.json b/provenance_dcm2niix/dataset_description.json new file mode 100644 index 000000000..e03264778 --- /dev/null +++ b/provenance_dcm2niix/dataset_description.json @@ -0,0 +1,14 @@ +{ + "Name": "Provenance metadata for DICOM to NIfTI conversion with dcm2niix", + "BIDSVersion": "1.10.0", + "DatasetType": "raw", + "License": "CC0", + "Authors": [ + "Boris ClΓ©net" + ], + "SourceDatasets": [ + { + "URL": "https://github.com/psychoinformatics-de/hirni-demo" + } + ] +} diff --git a/provenance_dcm2niix/docs/prov-dcm2niix.jsonld b/provenance_dcm2niix/docs/prov-dcm2niix.jsonld new file mode 100644 index 000000000..e9fff5665 --- /dev/null +++ b/provenance_dcm2niix/docs/prov-dcm2niix.jsonld @@ -0,0 +1,60 @@ +{ + "@context": "https://bids-specification--2099.org.readthedocs.build/en/2099/provenance-context.json", + "Records": { + "Software": [ + { + "Id": "bids::prov#dcm2niix-khhkm7u1", + "Label": "dcm2niix", + "AlternativeIdentifier": [ + "RRID:SCR_023517" + ], + "Version": "v1.0.20220720" + } + ], + "Activities": [ + { + "Id": "bids::prov#conversion-00f3a18f", + "Label": "Conversion", + "Command": "dcm2niix -o . -f sub-%i/anat/sub-%i_T1w sourcedata/hirni-demo/acq1/dicoms/example-dicom-structural-master/dicoms", + "AssociatedWith": [ + "bids::prov#dcm2niix-khhkm7u1" + ], + "Used": [ + "bids::prov#fedora-uldfv058", + "bids::sourcedata/hirni-demo/acq1/dicoms/example-dicom-structural-master/dicoms" + ] + } + ], + "Files": [ + { + "Id": "bids::sourcedata/hirni-demo/acq1/dicoms/example-dicom-structural-master/dicoms", + "Label": "dicoms" + }, + { + "Id": "bids::sub-02/anat/sub-02_T1w.nii", + "Label": "sub-02_T1w.nii", + "AtLocation": "sub-02/anat/sub-02_T1w.nii", + "GeneratedBy": [ + "bids::prov#conversion-00f3a18f" + ] + }, + { + "Id": "bids::sub-02/anat/sub-02_T1w.json", + "Label": "sub-02_T1w.json", + "AtLocation": "sub-02/anat/sub-02_T1w.json", + "GeneratedBy": [ + "bids::prov#conversion-00f3a18f" + ] + } + ], + "Datasets": [], + "prov:Entity": [], + "Environments": [ + { + "Id": "bids::prov#fedora-uldfv058", + "Label": "Fedora release 36 (Thirty Six)", + "OperatingSystem": "GNU/Linux 6.2.15-100.fc36.x86_64" + } + ] + } +} \ No newline at end of file diff --git a/provenance_dcm2niix/docs/prov-dcm2niix.png b/provenance_dcm2niix/docs/prov-dcm2niix.png new file mode 100644 index 000000000..51a1a48cd Binary files /dev/null and b/provenance_dcm2niix/docs/prov-dcm2niix.png differ diff --git a/provenance_dcm2niix/prov/prov-dcm2niix_act.json b/provenance_dcm2niix/prov/prov-dcm2niix_act.json new file mode 100644 index 000000000..92240cc12 --- /dev/null +++ b/provenance_dcm2niix/prov/prov-dcm2niix_act.json @@ -0,0 +1,16 @@ +{ + "Activities": [ + { + "Id": "bids::prov#conversion-00f3a18f", + "Label": "Conversion", + "Command": "dcm2niix -o . -f sub-%i/anat/sub-%i_T1w sourcedata/hirni-demo/acq1/dicoms/example-dicom-structural-master/dicoms", + "AssociatedWith": [ + "bids::prov#dcm2niix-khhkm7u1" + ], + "Used": [ + "bids::prov#fedora-uldfv058", + "bids::sourcedata/hirni-demo/acq1/dicoms/example-dicom-structural-master/dicoms" + ] + } + ] +} \ No newline at end of file diff --git a/provenance_dcm2niix/prov/prov-dcm2niix_ent.json b/provenance_dcm2niix/prov/prov-dcm2niix_ent.json new file mode 100644 index 000000000..ebfe4f710 --- /dev/null +++ b/provenance_dcm2niix/prov/prov-dcm2niix_ent.json @@ -0,0 +1,8 @@ +{ + "Files": [ + { + "Id": "bids::sourcedata/hirni-demo/acq1/dicoms/example-dicom-structural-master/dicoms", + "Label": "dicoms" + } + ] +} diff --git a/provenance_dcm2niix/prov/prov-dcm2niix_env.json b/provenance_dcm2niix/prov/prov-dcm2niix_env.json new file mode 100644 index 000000000..eb877c9b9 --- /dev/null +++ b/provenance_dcm2niix/prov/prov-dcm2niix_env.json @@ -0,0 +1,9 @@ +{ + "Environments": [ + { + "Id": "bids::prov#fedora-uldfv058", + "Label": "Fedora release 36 (Thirty Six)", + "OperatingSystem": "GNU/Linux 6.2.15-100.fc36.x86_64" + } + ] +} \ No newline at end of file diff --git a/provenance_dcm2niix/prov/prov-dcm2niix_soft.json b/provenance_dcm2niix/prov/prov-dcm2niix_soft.json new file mode 100644 index 000000000..79ba8da74 --- /dev/null +++ b/provenance_dcm2niix/prov/prov-dcm2niix_soft.json @@ -0,0 +1,12 @@ +{ + "Software": [ + { + "Id": "bids::prov#dcm2niix-khhkm7u1", + "Label": "dcm2niix", + "AlternativeIdentifier": [ + "RRID:SCR_023517" + ], + "Version": "v1.0.20220720" + } + ] +} \ No newline at end of file diff --git a/provenance_dcm2niix/sub-02/anat/sub-02_T1w.json b/provenance_dcm2niix/sub-02/anat/sub-02_T1w.json new file mode 100644 index 000000000..a325cde6e --- /dev/null +++ b/provenance_dcm2niix/sub-02/anat/sub-02_T1w.json @@ -0,0 +1,29 @@ +{ + "Modality": "MR", + "ManufacturersModelName": "nifti2dicom", + "SoftwareVersions": "0.4.11", + "SeriesDescription": "anat-T1w", + "ProtocolName": "anat-T1w", + "ImageType": ["DERIVED", "SECONDARY"], + "RawImage": false, + "SeriesNumber": 401, + "AcquisitionTime": "13:25:18.000000", + "AcquisitionNumber": 1, + "SliceThickness": 0.666667, + "SpacingBetweenSlices": 0.666667, + "ImageOrientationPatientDICOM": [ + 0.999032, + -0.0217884, + 0.0382096, + 0.0265195, + 0.991414, + -0.128044 ], + "ConversionSoftware": "dcm2niix", + "ConversionSoftwareVersion": "v1.0.20220720", + "GeneratedBy": [ + "bids::prov#conversion-00f3a18f" + ], + "SidecarGeneratedBy": [ + "bids::prov#conversion-00f3a18f" + ] +} \ No newline at end of file diff --git a/provenance_dcm2niix/sub-02/anat/sub-02_T1w.nii b/provenance_dcm2niix/sub-02/anat/sub-02_T1w.nii new file mode 100644 index 000000000..e69de29bb