-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d631e87
commit 7d3363e
Showing
10 changed files
with
222 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.PHONY: all | ||
|
||
all: createindex | ||
|
||
createindex: | ||
python createindex.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# schema | ||
Schema used in the SPEBT project codebase | ||
|
||
## make and upload | ||
If you change the `JSON` file names or add `JSON` file, run `make` before `git push` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import pathlib | ||
from bs4 import BeautifulSoup as bs | ||
|
||
|
||
# Get all json files in v1 folder | ||
path_posix_list = list(pathlib.Path('v1').glob('*.json')) | ||
# Make raw html | ||
raw_html = "" | ||
raw_html += '<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Schema API Usage</title></head><body>' | ||
raw_html += '<h1>Available API:</h1>' | ||
for path in path_posix_list: | ||
raw_html += '<li>/' + str(path)+'</li>' | ||
soup = bs(raw_html, 'html.parser') | ||
|
||
# Write to index.html | ||
with open('index.html', 'w') as f: | ||
f.write(soup.prettify()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Schema API Usage</title> | ||
</head> | ||
<body> | ||
<h1>Schema API Usage</h1> | ||
<h2>Available methods:</h2> | ||
<table> | ||
<tr> | ||
<th>Method</th> | ||
<th>Path</th> | ||
<th>Description</th> | ||
</tr> | ||
<tr> | ||
<td>GET</td> | ||
<td>https://spebt.github.io/schema/v1/pymatcal_main.json</td> | ||
<td>Pymatcal system matrix generattion configuration file schema</td> | ||
</tr> | ||
</table> | ||
</body> | ||
</html> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<meta content="width=device-width, initial-scale=1.0" name="viewport"/> | ||
<title> | ||
Schema API Usage | ||
</title> | ||
</head> | ||
<body> | ||
<h1> | ||
Available API: | ||
</h1> | ||
<li> | ||
/v1/relation.json | ||
</li> | ||
<li> | ||
/v1/FOV.json | ||
</li> | ||
<li> | ||
/v1/detector.json | ||
</li> | ||
<li> | ||
/v1/transformation_data.json | ||
</li> | ||
<li> | ||
/v1/main.json | ||
</li> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft-07/schema", | ||
"$id": "FOV.json", | ||
"title": "FOV schema", | ||
"description": "FOV section of the YAML configuration file schema.", | ||
"type": "object", | ||
"properties": { | ||
"N-voxels xyz": { | ||
"type": "array", | ||
"items": { | ||
"type": "integer" | ||
}, | ||
"minItems": 3, | ||
"maxItems": 3 | ||
}, | ||
"mm-per-voxel xyz": { | ||
"type": "array", | ||
"items": { | ||
"type": "number" | ||
}, | ||
"minItems": 3, | ||
"maxItems": 3 | ||
}, | ||
"N-subdivision xyz": { | ||
"type": "array", | ||
"items": { | ||
"type": "integer" | ||
}, | ||
"minItems": 3, | ||
"maxItems": 3 | ||
} | ||
}, | ||
"required": [ | ||
"N-voxels xyz", | ||
"mm-per-voxel xyz", | ||
"N-subdivision xyz" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft-07/schema", | ||
"$id": "detector.json", | ||
"title": "detector schema", | ||
"description": "Detector section of the YAML configuration file schema.", | ||
"type": "object", | ||
"properties": { | ||
"detector geometry": { | ||
"description": "Detector geometry", | ||
"type": "array", | ||
"items": { | ||
"type": "array" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"N-subdivision xyz": { | ||
"type": "array", | ||
"items": { | ||
"type": "integer" | ||
}, | ||
"minItems": 3, | ||
"maxItems": 3 | ||
}, | ||
"active geometry indices": { | ||
"type": "array", | ||
"items": { | ||
"type": "integer" | ||
}, | ||
"minItems": 1 | ||
} | ||
}, | ||
"required": [ | ||
"detector geometry", | ||
"N-subdivision xyz", | ||
"active geometry indices" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft-07/schema", | ||
"$id": "main.json", | ||
"title": "Pymatcal main schema", | ||
"description": "SPEBT system response matrix generation package configuration file schema. The configuration file is a YAML file.", | ||
"type": "object", | ||
"properties": { | ||
"detector": { | ||
"$ref": "detector.json" | ||
}, | ||
"FOV": { | ||
"$ref": "FOV.json" | ||
}, | ||
"relation": { | ||
"$ref": "relation.json" | ||
} | ||
}, | ||
"required": [ | ||
"detector", | ||
"FOV", | ||
"relation" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft-07/schema", | ||
"$id": "relation.json", | ||
"title": "Detector to FOV relation schema", | ||
"description": "Detector to FOV relation section of the YAML configuration file schema.\n Unit of length is mm. Unit of angle is degrees.", | ||
"type": "object", | ||
"properties": { | ||
"radial distance": { | ||
"$ref": "transformation_data.json" | ||
}, | ||
"tangential shift": { | ||
"$ref": "transformation_data.json" | ||
}, | ||
"rotations": { | ||
"$ref": "transformation_data.json" | ||
} | ||
}, | ||
"required": [ | ||
"radial distance, rotations" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft-07/schema", | ||
"$id": "transformation_data.json", | ||
"title": "Pymatcal transformation data schema", | ||
"description": "transformation data schema, used to define the transformation for the detector to FOV relation.", | ||
"type": "object", | ||
"properties": { | ||
"format": { | ||
"type": "string", | ||
"enum": [ | ||
"enumerate", | ||
"range" | ||
] | ||
}, | ||
"if": { | ||
"properties": { | ||
"format": { | ||
"const": "range" | ||
} | ||
} | ||
}, | ||
"then": { | ||
"properties": { | ||
"angles": { | ||
"type": "array", | ||
"items": { | ||
"type": "number" | ||
}, | ||
"minItems": 3, | ||
"maxItems": 3 | ||
} | ||
} | ||
}, | ||
"else": { | ||
"properties": { | ||
"angles": { | ||
"type": "array", | ||
"items": { | ||
"type": "number" | ||
}, | ||
"minItems": 1 | ||
} | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"format" | ||
] | ||
} |