From bfa80cddbcb3194e1cf9cce37c36d2b5ec03d221 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 3 Nov 2023 08:17:13 -0400 Subject: [PATCH] ENH: Add column definitions for channels.json --- bids-validator/validators/json/json.js | 2 ++ .../validators/json/schemas/channels.json | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 bids-validator/validators/json/schemas/channels.json diff --git a/bids-validator/validators/json/json.js b/bids-validator/validators/json/json.js index bf0c8aa65..2f0e63445 100644 --- a/bids-validator/validators/json/json.js +++ b/bids-validator/validators/json/json.js @@ -161,6 +161,8 @@ const selectSchema = (file) => { schema = require('./schemas/beh.json') } else if (file.name.endsWith('_motion.json')) { schema = require('./schemas/motion.json') + } else if (file.name.endsWith('_channels.json')) { + schema = require('./schemas/channels.json') } } return schema diff --git a/bids-validator/validators/json/schemas/channels.json b/bids-validator/validators/json/schemas/channels.json new file mode 100644 index 000000000..e6e32f947 --- /dev/null +++ b/bids-validator/validators/json/schemas/channels.json @@ -0,0 +1,36 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "type": "object", + "properties": { + "reference_frame": { + "$ref": "common_definitions.json#/definitions/ColumnDescription", + "title": "Reference Frame", + "properties": { + "$ref": "common_definitions.json#/definitions/ColumnDescription/properties", + "Levels": { + "$ref": "common_definitions.json#/definitions/ColumnDescription/properties/Levels", + "properties": { + "RotationOrder": { + "description": "The sequence in which the extrinsic rotations are applied around the three axes.", + "type": "string", + "enum": ["XYZ", "XZY", "YXZ", "YZX", "ZXY", "ZYX"] + }, + "RotationRule": { + "description": "The direction of rotation around each axis.", + "type": "string", + "enum": ["left-hand", "right-hand"] + }, + "SpatialAxes": { + "description": "The coordinate system in which the motion data are to be interpreted. A sequence of characters from the set `{'A', 'P', 'L', 'R', 'S', 'I', '_'}` indicating the direction of each axis. For example `\"ARS\"` indicates positive values in the X, Y, Z axes are respectively anterior, right, and superior of the origin, while `\"PLI\"` indicates positive values are posterior, left, and inferior of the origin. The `\"_\"` character may be used for unused axes.", + "type": "string", + "pattern": "^[APLRSI_]{3}$" + } + } + } + } + } + }, + "patternProperties": { + "^.+$": { "$ref": "common_definitions.json#/definitions/ColumnDescription" } + } +}