From d63a1113446c972f6900383bb1d4604518fd846d Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Wed, 21 Aug 2024 12:17:58 -0500 Subject: [PATCH 1/3] First pass at schematization of bep017 --- src/schema/objects/columns.yaml | 5 +++ src/schema/objects/entities.yaml | 9 ++++ src/schema/objects/extensions.yaml | 38 +++++++++++++--- src/schema/objects/metadata.yaml | 45 +++++++++++++++++++ src/schema/objects/suffixes.yaml | 8 ++++ src/schema/rules/files/deriv/relmat.yaml | 30 +++++++++++++ .../rules/sidecars/derivatives/relmat.json | 24 ++++++++++ .../tabular_data/derivatives/relmat.yaml | 14 ++++++ 8 files changed, 168 insertions(+), 5 deletions(-) create mode 100644 src/schema/rules/files/deriv/relmat.yaml create mode 100644 src/schema/rules/sidecars/derivatives/relmat.json create mode 100644 src/schema/rules/tabular_data/derivatives/relmat.yaml diff --git a/src/schema/objects/columns.yaml b/src/schema/objects/columns.yaml index d93145430e..feb4151bad 100644 --- a/src/schema/objects/columns.yaml +++ b/src/schema/objects/columns.yaml @@ -296,6 +296,11 @@ material: description: | Material of the electrode (for example, `Tin`, `Ag/AgCl`, `Gold`). type: string +matrix_index: + name: index + display_name: Matrix Index + description: Todo + type: integer metabolite_parent_fraction: name: metabolite_parent_fraction display_name: Metabolite parent fraction diff --git a/src/schema/objects/entities.yaml b/src/schema/objects/entities.yaml index 6facc34c0d..b447f0558f 100644 --- a/src/schema/objects/entities.yaml +++ b/src/schema/objects/entities.yaml @@ -152,6 +152,15 @@ label: This entity is only applicable to derivative data. type: string format: label +measure: + name: meas + display_name: Measure + description: | + Todo + + This entity is only applicable to derivative data. + type: string + format: label modality: name: mod display_name: Corresponding Modality diff --git a/src/schema/objects/extensions.yaml b/src/schema/objects/extensions.yaml index db38cf55b2..e9de4e13b3 100644 --- a/src/schema/objects/extensions.yaml +++ b/src/schema/objects/extensions.yaml @@ -63,16 +63,28 @@ con: Raw continuous data from a KIT/Yokogawa/Ricoh MEG system. Successor to the `.sqd` extension for raw continuous data. -dat: - value: .dat - display_name: MEG Fine-Calibration Format - description: | - A fine-calibration file used for Neuromag/Elekta/MEGIN MEG recording hardware. CTF: value: .ds/ display_name: CTF MEG Dataset Directory description: | A directory for MEG data, typically containing a `.meg4` file for the data and a `.res4` file for the resources. +dat: + value: .dat + display_name: MEG Fine-Calibration Format + description: | + A fine-calibration file used for Neuromag/Elekta/MEGIN MEG recording hardware. +dense_h5: + value: .dense.h5 + display_name: Dense H5 + description: Todo +dense_tsv: + value: .dense.tsv + display_name: Dense TSV + description: Todo +dense_zarr: + value: .dense.zarr + display_name: Dense Zarr + description: Todo dlabelnii: value: .dlabel.nii display_name: CIFTI-2 Dense Label File @@ -244,6 +256,18 @@ snirf: display_name: Shared Near Infrared Spectroscopy Format description: | HDF5 file organized according to the [SNIRF specification](https://github.com/fNIRS/snirf) +sparse_h5: + value: .sparse.h5 + display_name: Sparse H5 + description: Todo +sparse_tsv: + value: .sparse.tsv + display_name: Sparse TSV + description: Todo +sparse_zarr: + value: .sparse.zarr + display_name: Sparse Zarr + description: Todo sqd: value: .sqd display_name: SQD @@ -302,6 +326,10 @@ vmrk: A text marker file in the [BrainVision Core Data Format](https://www.brainproducts.com/support-resources/brainvision-core-data-format-1-0/). These files come in three-file sets, including a `.vhdr`, a `.vmrk`, and a `.eeg` file. +zarr: + value: .zarr + display_name: zarr + description: Todo Any: value: .* display_name: Any Extension diff --git a/src/schema/objects/metadata.yaml b/src/schema/objects/metadata.yaml index d9222005a1..d720f44e65 100644 --- a/src/schema/objects/metadata.yaml +++ b/src/schema/objects/metadata.yaml @@ -198,6 +198,13 @@ Authors: type: array items: type: string +Axes: + name: Axes + display_name: Axes + description: Todo + type: array + items: + type: object B0FieldIdentifier: name: B0FieldIdentifier display_name: B0 Field Identifier @@ -709,6 +716,11 @@ DigitizedLandmarks: `true` or `false` value indicating whether anatomical landmark points (fiducials) are contained within this recording. type: boolean +Directed: + name: Directed + display_name: Directed Graph + type: boolean + description: todo DispersionConstant: name: DispersionConstant display_name: Dispersion Constant @@ -2192,6 +2204,13 @@ NIRSCoordinateProcessingDescription: Has any post-processing (such as projection) been done on the optode positions (for example, `"surface_projection"`, `"n/a"`). type: string +NodeFiles: + name: NodeFiles + display_name: Node Files + descripiton: Todo + type: array + items: + type uri NonlinearGradientCorrection: name: NonlinearGradientCorrection display_name: Nonlinear Gradient Correction @@ -2199,6 +2218,11 @@ NonlinearGradientCorrection: Boolean stating if the image saved has been corrected for gradient nonlinearities by the scanner sequence. type: boolean +NonNegative: + name: NonNegative + display_name: Non Negative + description: Todo + type: boolean NumberOfVolumesDiscardedByScanner: name: NumberOfVolumesDiscardedByScanner display_name: Number Of Volumes Discarded By Scanner @@ -2679,6 +2703,11 @@ ReferencesAndLinks: items: type: string type: array +RelationshipMeasure: + name: RelationshipMeasure + display_name: Relationship Measure + descrption: Todo + type: string RepetitionTime: name: RepetitionTime display_name: Repetition Time @@ -3120,6 +3149,12 @@ SliceTiming: type: number minimum: 0 unit: s +Software: + name: Software + display_name: Software + description: todo + type: string + format: uri SoftwareFilters: name: SoftwareFilters display_name: Software Filters @@ -3583,6 +3618,11 @@ Units: (see [Units](SPEC_ROOT/common-principles.md#units)). type: string format: unit +ValidDiagonal: + name: ValidDiagonal + display_name: Valid Diagonal + description: Todo + type: boolean VascularCrushing: name: VascularCrushing display_name: Vascular Crushing @@ -3649,6 +3689,11 @@ WaterSuppressionTechnique: description: | The name of the pulse sequence used for water suppression (for example, `"CHESS"`, `"VAPOR"`). type: string +Weighted: + name: Weighted + display_name: Weighted Matrix + description: Todo + type: boolean WholeBloodAvail: name: WholeBloodAvail display_name: Whole Blood Avail diff --git a/src/schema/objects/suffixes.yaml b/src/schema/objects/suffixes.yaml index b370ef646a..7c33dafba5 100644 --- a/src/schema/objects/suffixes.yaml +++ b/src/schema/objects/suffixes.yaml @@ -697,6 +697,10 @@ nirs: value: nirs display_name: Near Infrared Spectroscopy description: Data associated with a Shared Near Infrared Spectroscopy Format file. +nodeindices: + value: nodeindices + display_name: Node Indices + description: Todo noRF: value: noRF display_name: No Radio Frequency Excitation Scan @@ -780,6 +784,10 @@ probseg: A probabilistic segmentation. This suffix may only be used in derivative datasets. +relmat: + value: relmat + display_name: Relationship Matrix + description: Todo sbref: value: sbref display_name: Single-band reference image diff --git a/src/schema/rules/files/deriv/relmat.yaml b/src/schema/rules/files/deriv/relmat.yaml new file mode 100644 index 0000000000..5a0ba86db6 --- /dev/null +++ b/src/schema/rules/files/deriv/relmat.yaml @@ -0,0 +1,30 @@ +--- +relmat: + entities: + measure: optional + datatypes: + - any + extensions: + - .json + - .tsv + - .h5 + - .zarr + - .sparse.tsv + - .sparse.h5 + - .sparse.zarr + - .dense.tsv + - .dense.h5 + - .dense.zarr + suffixes: + - relmat + +nodeindicies: + entities: + measure: optional + suffixes: + - nodeindicies + datatypes: + - any + extensions: + - .json + - .tsv diff --git a/src/schema/rules/sidecars/derivatives/relmat.json b/src/schema/rules/sidecars/derivatives/relmat.json new file mode 100644 index 0000000000..294f08cb7b --- /dev/null +++ b/src/schema/rules/sidecars/derivatives/relmat.json @@ -0,0 +1,24 @@ +Relmat: + selectors: + - suffix == 'relmat' + fields: + Directed: required + RelationshipMeasure: required + Software: required + ValidDiagonal: required + Weighted: required + Axes: recommended + NodeFiles: recommended + NonNegative: recommended + AdditionalMatrixDimensions: optional + AdditionalMatrixDimensionDescription: optional + AdditionalMatrixDimensionsUnits: optional + Description: optional + MeasureDescription: optional + MeasurePoint: optional + MeasureUnits: optional + NodeIndicesFile: optional + Serialization: + level: optional + level_addendum: required if `StorageFormat` is "UpperTriangular" or "LowerTriangular" + Sources: optional diff --git a/src/schema/rules/tabular_data/derivatives/relmat.yaml b/src/schema/rules/tabular_data/derivatives/relmat.yaml new file mode 100644 index 0000000000..f609614f78 --- /dev/null +++ b/src/schema/rules/tabular_data/derivatives/relmat.yaml @@ -0,0 +1,14 @@ +--- +NodeIndices: + selectors: + suffix == "nodeindices" + columns: + matrix_index: required + node_file: required + node_index: required + additional_columns: allowed + initial_columns: + - matrix_index + - node_file + - node_index + index_columns: [matrix_index] From 7bf1cef414f3e537bda3c911985675ae3170d4eb Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Wed, 21 Aug 2024 13:01:00 -0500 Subject: [PATCH 2/3] rename incorrect extensioned file. --- src/schema/objects/columns.yaml | 10 ++++++++++ .../sidecars/derivatives/{relmat.json => relmat.yaml} | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) rename src/schema/rules/sidecars/derivatives/{relmat.json => relmat.yaml} (96%) diff --git a/src/schema/objects/columns.yaml b/src/schema/objects/columns.yaml index feb4151bad..458bcd3da0 100644 --- a/src/schema/objects/columns.yaml +++ b/src/schema/objects/columns.yaml @@ -344,6 +344,16 @@ name__segmentations: description: | The unique label name. type: string +node_file: + name: node_file + display_name: Node Filename + description: Todo + type: uri +node_index: + name: node_index + display_name: Node Index + description: Todo + type: number notch: name: notch display_name: Notch frequencies diff --git a/src/schema/rules/sidecars/derivatives/relmat.json b/src/schema/rules/sidecars/derivatives/relmat.yaml similarity index 96% rename from src/schema/rules/sidecars/derivatives/relmat.json rename to src/schema/rules/sidecars/derivatives/relmat.yaml index 294f08cb7b..bdaf700ab3 100644 --- a/src/schema/rules/sidecars/derivatives/relmat.json +++ b/src/schema/rules/sidecars/derivatives/relmat.yaml @@ -1,6 +1,6 @@ Relmat: selectors: - - suffix == 'relmat' + - suffix == "relmat" fields: Directed: required RelationshipMeasure: required From 1b968dfc41355601f9c35f88f0b76ee6a1db488b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 21 Aug 2024 18:06:13 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/schema/objects/metadata.yaml | 2 +- src/schema/rules/sidecars/derivatives/relmat.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/schema/objects/metadata.yaml b/src/schema/objects/metadata.yaml index d720f44e65..61cba2358f 100644 --- a/src/schema/objects/metadata.yaml +++ b/src/schema/objects/metadata.yaml @@ -3690,7 +3690,7 @@ WaterSuppressionTechnique: The name of the pulse sequence used for water suppression (for example, `"CHESS"`, `"VAPOR"`). type: string Weighted: - name: Weighted + name: Weighted display_name: Weighted Matrix description: Todo type: boolean diff --git a/src/schema/rules/sidecars/derivatives/relmat.yaml b/src/schema/rules/sidecars/derivatives/relmat.yaml index bdaf700ab3..c71afc09fe 100644 --- a/src/schema/rules/sidecars/derivatives/relmat.yaml +++ b/src/schema/rules/sidecars/derivatives/relmat.yaml @@ -18,7 +18,7 @@ Relmat: MeasurePoint: optional MeasureUnits: optional NodeIndicesFile: optional - Serialization: + Serialization: level: optional level_addendum: required if `StorageFormat` is "UpperTriangular" or "LowerTriangular" Sources: optional