Skip to content

Commit

Permalink
ENH: Add column definitions for channels.json
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Nov 3, 2023
1 parent 4b1b882 commit bfa80cd
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bids-validator/validators/json/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 36 additions & 0 deletions bids-validator/validators/json/schemas/channels.json
Original file line number Diff line number Diff line change
@@ -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" }
}
}

0 comments on commit bfa80cd

Please sign in to comment.