Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SCHEMA] Add metadata term files #774

Merged
merged 76 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
acc3b9a
[SCHEMA] Add metadata term files (#762)
tsalo Apr 13, 2021
2ecfc88
Improve make_metadata_table docstring.
tsalo Apr 13, 2021
b5f182c
Start addressing inconsistencies between rendered and hardcoded tables.
tsalo Apr 13, 2021
63b2027
Merge branch 'master' into metadata-schema
tsalo Apr 14, 2021
4d6cd67
Fix typos in PET metadata
tsalo Apr 26, 2021
c2a02ec
Add metadata fields from qMRI appendix.
tsalo Apr 26, 2021
e8607d2
Fix.
tsalo Apr 26, 2021
c29aa2f
Address duplicate datatypes.
tsalo Apr 26, 2021
58926cf
Wrap example strings in code.
tsalo Apr 26, 2021
675f9f5
Use enum for n/a instead of pattern.
tsalo Apr 26, 2021
4dcab2b
Replace "string" with "n/a" when appropriate.
tsalo Apr 26, 2021
ae7715c
Address some inconsistencies.
tsalo Apr 26, 2021
db5ab58
Take a crack as SpatialReference.
tsalo Apr 26, 2021
47d6d0f
Apply suggestions from code review
tsalo Apr 27, 2021
947ad56
Update tools/schemacode/schema.py
effigies Apr 27, 2021
efffea9
search_structure --> dereference_yaml
tsalo Apr 27, 2021
3deb0a6
Use faster loading approach.
tsalo Apr 27, 2021
4161f1c
Fix deprecation link.
tsalo Apr 27, 2021
446cfe6
Apply suggestions from code review
tsalo Apr 28, 2021
abacfef
Update 01-magnetic-resonance-imaging-data.md
tsalo Apr 28, 2021
f00fdd0
Merge branch 'master' into metadata-schema
tsalo Apr 28, 2021
9ffbe7a
Add B0FieldIdentifier and B0FieldSource.
tsalo Apr 28, 2021
7167252
Revert type changes and add TODOs to check them.
tsalo Apr 28, 2021
96d6b13
Update tools/schemacode/schema.py
effigies Apr 28, 2021
e308008
Replace remaining relative links.
tsalo Apr 28, 2021
830029d
Merge branch 'metadata-schema' of https://github.com/bids-standard/bi…
tsalo Apr 28, 2021
e5bd6e7
Apply suggestions from code review
tsalo Apr 28, 2021
05f5c60
Add new coordinate systems from #775.
tsalo Apr 30, 2021
352930a
Grab hack from #781 (which wasn't merged).
tsalo Apr 30, 2021
d36b00e
Merge branch 'master' into metadata-schema
tsalo May 10, 2021
b7c94f8
Create HED.yaml
tsalo May 10, 2021
efd79f3
boldify table headers
Remi-Gau May 23, 2021
86bc69e
add device info metadata
Remi-Gau May 30, 2021
0737cab
fix table fences
Remi-Gau May 30, 2021
54a3174
fix cell padding
Remi-Gau May 30, 2021
4031283
fix cell padding
Remi-Gau May 30, 2021
8967140
Merge pull request #811 from Remi-Gau/remi-physio-metadata
sappelhoff May 31, 2021
d7a5615
Merge pull request #808 from Remi-Gau/fix_table_header
sappelhoff Jun 1, 2021
95e5599
Merge branch 'master' into metadata-schema
tsalo Jun 7, 2021
e5a5655
Fix up DICOM tags in metadata.
tsalo Jun 7, 2021
3e2a56d
Leverage "name" field for section-specific metadata definitions.
tsalo Jun 7, 2021
b8d0a75
Merge branch 'master' into metadata-schema
tsalo Jun 9, 2021
6ebde13
composite instances --> measurements
tsalo Jun 9, 2021
1405b23
Fix name of HED field.
tsalo Jun 16, 2021
f3fd1b5
Fix string formatting in coordinate system fields.
tsalo Jun 16, 2021
670ca5b
Move "preferably same as" to section-specific text.
tsalo Jun 16, 2021
39f5336
Standardize DICOM Tag format.
tsalo Jun 16, 2021
78499f1
Move mentions of DICOM Tags out of definitions.
tsalo Jun 16, 2021
0954aea
Apply suggestions from code review
tsalo Jun 17, 2021
6273e3d
Generalize SoftwareFilters example.
tsalo Jun 17, 2021
c0df0ad
Distinguish AnatomicalLandmarkCoordinates definitions.
tsalo Jun 17, 2021
30992ee
Rename fmapEchoTime to match new format.
tsalo Jun 17, 2021
6a7e001
Apply suggestions from code review
tsalo Jun 24, 2021
680257d
Apply suggestions from code review
tsalo Jun 29, 2021
c13df8d
Address review.
tsalo Jun 29, 2021
34d9435
Fix example manufacturer names.
tsalo Jun 29, 2021
9ffaa12
Merge branch 'master' into metadata-schema
tsalo Jun 29, 2021
313de15
TEMPORARY: fix osipi URL (revert when osipi.org is back)
sappelhoff Jun 30, 2021
316453f
Fix regex for identifying macros.
tsalo Jun 30, 2021
890b364
Partially address review.
tsalo Jun 30, 2021
e5c130e
Do not assume minItems is 1 for array terms.
tsalo Jun 30, 2021
90c00d2
composite instances --> measurements (again)
tsalo Jul 1, 2021
af31fec
Update src/schema/metadata/MagneticFieldStrength.yaml
tsalo Jul 1, 2021
d9b3576
Update description to PharmaceuticalDoseTime
mnoergaard Jul 5, 2021
4a9bf0d
Update 09-positron-emission-tomography.md
mnoergaard Jul 5, 2021
def5ae3
fix table pipe alignment
sappelhoff Jul 5, 2021
9e6c75d
add pharmaceuticaldosetime fix to schema
sappelhoff Jul 5, 2021
26450b0
fix str examples
sappelhoff Jul 5, 2021
7bb90d8
Apply suggestions from code review
tsalo Jul 5, 2021
a803334
Update src/schema/metadata/RepetitionTimeExcitation.yaml
tsalo Jul 5, 2021
371a7e1
Merge branch 'master' into metadata-schema
tsalo Jul 13, 2021
34760d8
Add DoseCalibrationFactor.
tsalo Jul 13, 2021
85d60e2
Update ScanDate definition and deprecate it.
tsalo Jul 13, 2021
0c76b93
Remove hardcoded tables.
tsalo Jul 13, 2021
763c90a
Remove unused links.
tsalo Jul 13, 2021
43166e1
Update tools/schemacode/schema.py
tsalo Jul 13, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions pdf_build_src/process_markdowns.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ def process_macros(duplicated_src_dir_path):

# Replace code snippets in the text with their outputs
matches = re.findall("({{.*?}})", contents)
matches = re.findall(re.compile("({{.*?}})", re.DOTALL), contents)
for m in matches:
# Remove macro delimiters to get *just* the function call
function_string = m.strip("{} ")
Expand Down
14 changes: 14 additions & 0 deletions src/02-common-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,20 @@ Note that if a field name included in the data dictionary matches a column name
then that field MUST contain a description of the corresponding column,
using an object containing the following fields:

{{ MACROS___make_metadata_table(
{
"LongName": "OPTIONAL",
"Description": (
"RECOMMENDED",
"The description of the column.",
),
"Levels": "RECOMMENDED",
"Units": "RECOMMENDED",
"TermURL": "RECOMMENDED",
"HED": "OPTIONAL",
sappelhoff marked this conversation as resolved.
Show resolved Hide resolved
}
) }}

| **Key name** | **Requirement level** | **Data type** | **Description** |
| ------------ | --------------------- | --------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| LongName | OPTIONAL | [string][] | Long (unabbreviated) name of the column. |
Expand Down
24 changes: 24 additions & 0 deletions src/03-modality-agnostic-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@ Templates:
The file `dataset_description.json` is a JSON file describing the dataset.
Every dataset MUST include this file with the following fields:

{{ MACROS___make_metadata_table(
{
"Name": "REQUIRED",
"BIDSVersion": "REQUIRED",
"HEDVersion": "RECOMMENDED",
"DatasetType": "RECOMMENDED",
"License": "RECOMMENDED",
"Authors": "OPTIONAL",
"Acknowledgements": "OPTIONAL",
"HowToAcknowledge": "OPTIONAL",
"Funding": "OPTIONAL",
"EthicsApprovals": "OPTIONAL",
"ReferencesAndLinks": "OPTIONAL",
"DatasetDOI": "OPTIONAL",
}
) }}

| **Key name** | **Requirement level** | **Data type** | **Description** |
|--------------------|-----------------------|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Name | REQUIRED | [string][] | Name of the dataset. |
Expand Down Expand Up @@ -69,6 +86,13 @@ In addition to the keys for raw BIDS datasets,
derived BIDS datasets include the following REQUIRED and RECOMMENDED
`dataset_description.json` keys:

{{ MACROS___make_metadata_table(
{
"GeneratedBy": "REQUIRED",
"SourceDatasets": "RECOMMENDED",
}
) }}

| **Key name** | **Requirement level** | **Data type** | **Description** |
|----------------|-----------------------|--------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| GeneratedBy | REQUIRED | [array][] of [objects][] | Used to specify provenance of the derived dataset. See table below for contents of each object. |
Expand Down
255 changes: 254 additions & 1 deletion src/04-modality-specific-files/01-magnetic-resonance-imaging-data.md

Large diffs are not rendered by default.

138 changes: 138 additions & 0 deletions src/04-modality-specific-files/02-magnetoencephalography.md

Large diffs are not rendered by default.

88 changes: 88 additions & 0 deletions src/04-modality-specific-files/03-electroencephalography.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ be specified.

Generic fields MUST be present:

{{ MACROS___make_metadata_table(
{
"TaskName": "REQUIRED",
}
) }}

| **Key name** | **Requirement level** | **Data type** | **Description** |
| ------------ | --------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| TaskName | REQUIRED | [string][] | Name of the task. No two tasks should have the same name. The task label included in the file name is derived from this TaskName field by removing all non-alphanumeric (`[a-zA-Z0-9]`) characters. For example `TaskName` `"faces n-back"` will correspond to task label `facesnback`. A RECOMMENDED convention is to name resting state task using labels beginning with `rest`. |
Expand All @@ -94,6 +100,21 @@ SHOULD be present: For consistency between studies and institutions, we
encourage users to extract the values of these fields from the actual raw data.
Whenever possible, please avoid using ad hoc wording.

{{ MACROS___make_metadata_table(
{
"InstitutionName": "RECOMMENDED",
"InstitutionAddress": "RECOMMENDED",
"Manufacturer": "RECOMMENDED",
"ManufacturersModelName": "RECOMMENDED",
"SoftwareVersions": "RECOMMENDED",
"TaskDescription": "RECOMMENDED",
"Instructions": "RECOMMENDED",
"CogAtlasID": "RECOMMENDED",
"CogPOID": "RECOMMENDED",
"DeviceSerialNumber": "RECOMMENDED",
}
) }}

| **Key name** | **Requirement level** | **Data type** | **Description** |
| ---------------------- | --------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| InstitutionName | RECOMMENDED | [string][] | The name of the institution in charge of the equipment that produced the measurements. |
Expand All @@ -109,6 +130,15 @@ Whenever possible, please avoid using ad hoc wording.

Specific EEG fields MUST be present:

{{ MACROS___make_metadata_table(
{
"EEGReference": "REQUIRED",
"SamplingFrequency": ("REQUIRED", "The sampling frequency of data channels that deviate from the main sampling frequency SHOULD be specified in the `channels.tsv` file."),
"PowerLineFrequency": "REQUIRED",
"SoftwareFilters": "REQUIRED",
}
) }}

| **Key name** | **Requirement level** | **Data type** | **Description** |
| ------------------ | --------------------- | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| EEGReference | REQUIRED | [string][] | General description of the reference scheme used and (when applicable) of location of the reference electrode in the raw recordings (for example, `"left mastoid"`, `"Cz"`, `"CMS"`). If different channels have a different reference, this field should have a general description and the channel specific reference should be defined in the `channels.tsv` file. |
Expand All @@ -118,6 +148,27 @@ Specific EEG fields MUST be present:

SHOULD be present:

{{ MACROS___make_metadata_table(
{
"CapManufacturer": "RECOMMENDED",
"CapManufacturersModelName": "RECOMMENDED",
"EEGChannelCount": "RECOMMENDED",
"ECGChannelCount": "RECOMMENDED",
"EMGChannelCount": "RECOMMENDED",
"EOGChannelCount": "RECOMMENDED",
"MiscChannelCount": "RECOMMENDED",
"TriggerChannelCount": "RECOMMENDED",
"RecordingDuration": "RECOMMENDED",
"RecordingType": "RECOMMENDED",
"EpochLength": "RECOMMENDED",
"EEGGround": "RECOMMENDED",
"HeadCircumference": "RECOMMENDED",
"EEGPlacementScheme": "RECOMMENDED",
"HardwareFilters": "RECOMMENDED",
"SubjectArtefactDescription": "RECOMMENDED",
}
) }}

| **Key name** | **Requirement level** | **Data type** | **Description** |
| -------------------------- | --------------------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| CapManufacturer | RECOMMENDED | [string][] | Name of the cap manufacturer (for example, `"EasyCap"`). |
Expand Down Expand Up @@ -352,12 +403,30 @@ head.

General fields:

{{ MACROS___make_metadata_table(
{
"IntendedFor": (
"OPTIONAL",
"This identifies the MRI or CT scan associated with the electrodes, "
"landmarks, and fiducials.",
)
}
) }}

| **Key name** | **Requirement level** | **Data type** | **Description** |
| ------------ | --------------------- | ------------- | -------------------------------------------------------------------------------- |
| IntendedFor | OPTIONAL | [string][] | Relative path to associate the electrodes, landmarks and fiducials to an MRI/CT. |

Fields relating to the EEG electrode positions:

{{ MACROS___make_metadata_table(
{
"EEGCoordinateSystem": "REQUIRED",
"EEGCoordinateUnits": "REQUIRED",
"EEGCoordinateSystemDescription": 'RECOMMENDED, but REQUIRED if `EEGCoordinateSystem` is `"Other"`',
}
) }}

| **Key name** | **Requirement level** | **Data type** | **Description** |
| ------------------------------ | --------------------------------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| EEGCoordinateSystem | REQUIRED | [string][] | Defines the coordinate system for the EEG sensors. See [Appendix VIII](../99-appendices/08-coordinate-systems.md) for a list of restricted keywords for coordinate systems. If `"Other"`, provide definition of the coordinate system in `EEGCoordinateSystemDescription`. |
Expand All @@ -366,6 +435,16 @@ Fields relating to the EEG electrode positions:

Fields relating to the position of fiducials measured during an EEG session/run:

{{ MACROS___make_metadata_table(
{
"FiducialsDescription": "OPTIONAL",
"FiducialsCoordinates": "RECOMMENDED",
"FiducialsCoordinateSystem": "RECOMMENDED",
"FiducialsCoordinateUnits": "RECOMMENDED",
"FiducialsCoordinateSystemDescription": 'RECOMMENDED, but REQUIRED if `FiducialsCoordinateSystem` is `"Other"`',
}
) }}

| **Key name** | **Requirement level** | **Data type** | **Description** |
| ------------------------------------ | --------------------------------------------------------------------- | ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| FiducialsDescription | OPTIONAL | [string][] | Free-form text description of how the fiducials such as vitamin-E capsules were placed relative to anatomical landmarks, and how the position of the fiducials were measured (for example, both with Polhemus and with T1w MRI). |
Expand All @@ -376,6 +455,15 @@ Fields relating to the position of fiducials measured during an EEG session/run:

Fields relating to the position of anatomical landmark measured during an EEG session/run:

{{ MACROS___make_metadata_table(
{
"AnatomicalLandmarkCoordinates": "RECOMMENDED",
"AnatomicalLandmarkCoordinateSystem": ("RECOMMENDED", "Preferably the same as the `EEGCoordinateSystem`."),
"AnatomicalLandmarkCoordinateUnits": "RECOMMENDED",
"AnatomicalLandmarkCoordinateSystemDescription": 'RECOMMENDED, but REQUIRED if `AnatomicalLandmarkCoordinateSystem` is `"Other"`',
}
) }}

| **Key name** | **Requirement level** | **Data type** | **Description** |
| --------------------------------------------- | ------------------------------------------------------------------------------ | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| AnatomicalLandmarkCoordinates | RECOMMENDED | [object][] of [arrays][] | Key:value pairs of the labels and 3-D digitized position of anatomical landmarks, interpreted following the `AnatomicalLandmarkCoordinateSystem` (for example, `{"NAS": [12.7,21.3,13.9], "LPA": [5.2,11.3,9.6], "RPA": [20.2,11.3,9.1]}`). Each array MUST contain three numeric values corresponding to x, y, and z axis of the coordinate system in that exact order. |
Expand Down
Loading