Skip to content

Commit

Permalink
feat: new map schema
Browse files Browse the repository at this point in the history
  • Loading branch information
xgui3783 committed Aug 19, 2024
1 parent 820bcb7 commit 258229e
Show file tree
Hide file tree
Showing 5 changed files with 284 additions and 27 deletions.
6 changes: 5 additions & 1 deletion siibra/atlases/parcellationmap/v0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,17 @@
"items": {
"$ref": "urn:siibra-local:siibra/attr/v0.1.json"
}
},
"region_mapping": {
"$ref": "urn:siibra-local:siibra/attr/util/region_mapping/v0.1.json"
}
},
"required": [
"@type",
"maptype",
"parcellation_id",
"space_id"
"space_id",
"region_mapping"
],
"additionalProperties": false
}
26 changes: 0 additions & 26 deletions siibra/attr/data/_volume_base/v0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
},
"colormap": {
"$ref": "#/definitions/colormap"
},
"mapping": {
"type": "object",
"patternProperties": {
".+": {
"$ref": "#/definitions/mappingValue"
}
}
}
},
"required": [
Expand All @@ -30,24 +22,6 @@
"const": "magma"
}
]
},
"mappingValue": {
"type": "object",
"properties": {
"range": {
"type": "array",
"items": {
"type": "number"
}
},
"color": {
"type": "string"
},
"label": {
"type": "number"
}
},
"additionalProperties": false
}
}
}
133 changes: 133 additions & 0 deletions siibra/attr/desc/attribute_mapping/v0.1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"oneOf": [
{
"type": "object",
"properties": {
"parcellation_id": {
"type": "string"
},
"region_mapping": {
"$ref": "urn:siibra-local:siibra/attr/util/region_mapping/v0.1.json"
}
},
"required": ["parcellation_id", "region_mapping"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"ref_type": {
"$ref": "#/definitions/ebrainsref_type"
},
"refs": {
"$ref": "#/definitions/ebrainsref_mapping"
}
}
}
],
"properties": {
"@type": {
"const": "siibra/attr/desc/attribute_mapping/v0.1"
}
},
"required": [
"@type"
],
"examples": [
{
"@type": "siibra/attr/desc/attribute_mapping/v0.1",
"parcellation_id": "minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-300",
"region_mappings": {
"Area 45 (IFG) - left hemisphere": [
{
"@type": "volume/ref",
"label": 1,
"target": "Left hemisphere volume of Julich Brain 3.0.3 in ICBM 152 space",
"color": "#A76792"
}
],
"Area 45 (IFG) - right hemisphere": [
{
"@type": "volume/ref",
"label": 1,
"target": "Right hemisphere volume of Julich Brain 3.0.3 in ICBM 152 space",
"color": "#A76792"
}
]
}
},
{
"@type": "siibra/attr/desc/attribute_mapping/v0.1",
"parcellation_id": "minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-300",
"region_mappings": {
"Area 45 (IFG) - left hemisphere": [
{
"@type": "csv/row-index",
"index": 0
}
],
"Area 44 (IFG) - left hemisphere": [
{
"@type": "csv/row-index",
"index": 1
}
]
}
},
{
"@type": "siibra/attr/desc/attribute_mapping/v0.1",
"ref_type": "openminds/DatasetVersion",
"refs": {
"cb40a501-b155-4c2f-8df3-0ee7c5f1ed00": [
{
"target": "Detailed map of VTM (Amygdala) - left hemisphere in Julich Brain in Big Brain"
},
{
"target": "Detailed map of VTM (Amygdala) - right hemisphere in Julich Brain in Big Brain"
}
]
}
}
],
"definitions": {
"ebrainsref_type": {
"oneOf": [
{
"const": "openminds/DatasetVersion"
},
{
"const": "openminds/Dataset"
},
{
"const": "openminds/AtlasAnnotation"
},
{
"const": "minds/core/dataset/v1.0.0"
}
]
},
"ebrainsref_mapping": {
"type": "object",
"properties": {
"refs": {
"type": "object",
"patternProperties": {
"^[0-9a-f-]+$": {
"type": "array",
"items": {
"type": "object",
"properties": {
"target": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
3 changes: 3 additions & 0 deletions siibra/attr/desc/v0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
},
{
"$ref": "urn:siibra-local:siibra/attr/desc/categorization/v0.1.json"
},
{
"$ref": "urn:siibra-local:siibra/attr/desc/attribute_mapping/v0.1.json"
}
]
}
143 changes: 143 additions & 0 deletions siibra/attr/util/region_mapping/v0.1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"patternProperties": {
"^.*$": {
"type": "array",
"items": {
"$ref": "#/definitions/region-mapping-target"
}
}
},
"description": "Describes how a subset of regions in a parcellation scheme connects to other attributes. At the moment, labelled volume mapping, statistical volume linking, and csv/row-index can be described. \n\nPlease note that this schema is not meant to be standalone, as the parcellation_id is deliberately not included. The parent node should contain parcellation_id.",
"examples": [
{
"Area 45 (IFG) - left hemisphere": [
{
"@type": "volume/ref",
"label": 1,
"target": "Left hemisphere volume of Julich Brain 3.0.3 in ICBM 152 space",
"color": "#A76792"
}
]
},
{
"Area 45 (IFG) - left hemisphere": [
{
"@type": "volume/ref",
"range": [0, 0.98],
"target": "Statistical map of Area 45 (IFG) - left hemisphere in ICBM 152 space"
}
]
},
{
"Component 3: Calcarine cortex posterior": [
{
"@type": "volume/ref",
"subspace": [
":",
":",
":",
2
],
"range": [],
"target": "DiFuMo Atlas (64 dimensions) on MNI 152 ICBM 2009c Nonlinear Asymmetric - statistical - 32 regions"
}
]
},
{
"Area 45 (IFG) - left hemisphere": [
{
"@type": "csv/row-index",
"index": 0
}
]
}
],
"definitions": {
"target_protocol": {
"type": "object",
"properties": {
"target": {
"type": "string"
}
}
},
"region-mapping-target": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/target_protocol"
}
],
"oneOf": [
{
"$ref": "#/definitions/volume"
},
{
"$ref": "#/definitions/row-index"
}
]
},
"volume": {
"type": "object",
"oneOf": [
{
"type": "object",
"properties": {
"label": {
"type": "number"
},
"color": {
"type": "string",
"pattern": "#[a-fA-F0-9]{6}"
}
},
"required": ["label"]
},
{
"type": "object",
"properties": {
"range": {
"type": "array",
"items": {
"type": "number"
}
},
"subspace": {
"type": "array",
"items": {
"anyOf": [
{
"const": ":"
},
{
"type": "number"
}
]
}
}
},
"required": ["range"]
}
],
"properties": {
"@type": {
"const": "volume/ref"
}
},
"required": ["@type"]
},
"row-index": {
"type": "object",
"properties": {
"@type": {
"const": "csv/row-index"
},
"index": {
"type": "number"
}
}
}
}
}

0 comments on commit 258229e

Please sign in to comment.