Skip to content

Commit

Permalink
fix map schema
Browse files Browse the repository at this point in the history
  • Loading branch information
xgui3783 committed Jul 16, 2024
1 parent f5af323 commit 11acb9b
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 40 deletions.
2 changes: 1 addition & 1 deletion code/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ValidationResult(Enum):

ROOT_DIR = os.path.abspath(f"{os.path.dirname(os.path.realpath(__file__))}/..")

skip_path = ("venv", "siibra-configurations/maps")
skip_path = ("venv",)

skip_types = (
"siibra/feature/timeseries/activity/v0.1",
Expand Down
17 changes: 2 additions & 15 deletions siibra/atlases/parcellationmap/v0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "object",
"properties": {
"@type": {
"const": "siibra/atlases/parcellation_map/v0.1"
"const": "siibra/atlases/parcellationmap/v0.1"
},
"maptype": {
"type": "string",
Expand All @@ -29,26 +29,13 @@
"items": {
"$ref": "urn:siibra-local:siibra/attr/v0.1.json"
}
},
"region_attributes": {
"type": "object",
"attributes": {
"type": "array",
"items": {
"$ref": "urn:siibra-local:siibra/attr/v0.1.json"
}
},
"required": [
"attributes"
]
}
},
"required": [
"@type",
"maptype",
"parcellation_id",
"space_id",
"region_attributes"
"space_id"
],
"additionalProperties": false
}
72 changes: 72 additions & 0 deletions siibra/attr/data/_volume_base/v0.1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"url": {
"type": "string"
},
"space_id": {
"type": "string"
},
"colormap": {
"$ref": "#/definitions/colormap"
},
"mapping": {
"type": "object",
"patternProperties": {
".+": {
"$ref": "#/definitions/mappingValue"
}
}
}
},
"required": [
"url"
],
"definitions": {
"format": {
"oneOf": [
{
"const": "neuroglancer/precomputed"
},
{
"const": "neuroglancer/precompmesh"
},
{
"const": "nii"
},
{
"const": "gii-mesh"
},
{
"const": "gii-label"
}
]
},
"colormap": {
"oneOf": [
{
"const": "magma"
}
]
},
"mappingValue": {
"type": "object",
"properties": {
"range": {
"type": "array",
"items": {
"type": "number"
}
},
"color": {
"type": "string"
},
"label": {
"type": "number"
}
},
"additionalProperties": false
}
}
}
18 changes: 1 addition & 17 deletions siibra/attr/data/image/v0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,20 @@
},
"format": {
"$ref": "#/definitions/format"
},
"url": {
"type": "string"
},
"space_id": {
"type": "string"
}
},
"required": [
"@type",
"format",
"url"
"format"
],
"definitions": {
"format": {
"oneOf": [
{
"const": "neuroglancer/precomputed"
},
{
"const": "neuroglancer/precompmesh"
},
{
"const": "nii"
},
{
"const": "gii-mesh"
},
{
"const": "gii-label"
}
]
}
Expand Down
40 changes: 40 additions & 0 deletions siibra/attr/data/mesh/v0.1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"allOf": [
{
"$ref": "urn:siibra-local:siibra/attr/data/_volume_base/v0.1.json"
}
],
"properties": {
"@type": {
"const": "siibra/attr/data/mesh/v0.1"
},
"format": {
"$ref": "#/definitions/format"
}
},
"required": [
"@type",
"format",
"url"
],
"definitions": {
"format": {
"oneOf": [
{
"const": "neuroglancer/precompmesh"
},
{
"const": "gii-mesh"
},
{
"const": "gii-label"
},
{
"const": "freesurfer-annot"
}
]
}
}
}
3 changes: 3 additions & 0 deletions siibra/attr/data/v0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
{
"$ref": "urn:siibra-local:siibra/attr/data/image/v0.1.json"
},
{
"$ref": "urn:siibra-local:siibra/attr/data/mesh/v0.1.json"
},
{
"$ref": "urn:siibra-local:siibra/attr/data/tabular/v0.1.json"
}
Expand Down
8 changes: 1 addition & 7 deletions siibra/attr/desc/v0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,7 @@
"$ref": "urn:siibra-local:siibra/attr/desc/description/v0.1.json"
},
{
"$ref": "urn:siibra-local:siibra/attr/desc/cohort/v0.1.json"
},
{
"$ref": "urn:siibra-local:siibra/attr/desc/paradigm/v0.1.json"
},
{
"$ref": "urn:siibra-local:siibra/attr/desc/aggregateby/v0.1.json"
"$ref": "urn:siibra-local:siibra/attr/desc/facet/v0.1.json"
}
]
}

0 comments on commit 11acb9b

Please sign in to comment.