Skip to content
Snippets Groups Projects
Commit 8e7f79d9 authored by Simon Wittl's avatar Simon Wittl
Browse files

added exampl

parent e5c3b470
No related branches found
No related tags found
No related merge requests found
{
"focal_spot_position_mm": [
2724.71682,
1690.5,
193.29345
],
"detector_center_position_mm": [
1902.85619,
1690.5,
121.38996
],
"detector_horizontal_vector": [
-0.08715574274765814,
0.0,
0.9961946980917458
],
"detector_vertical_vector": [
-0.0,
-1.0000000000000002,
0.0
],
"detector_center_orientation_quat": [
0.6755902076156602,
-0.0,
0.737277336810124,
0.0
],
"pixel_pitch_mm": 0.07479989711934157,
"image_width_px": 1944,
"image_heigth_px": 1536,
"projection_matrix_cera": [
[
-0.17494827015512399,
0.0,
0.988513847201303,
285.61124242325764
],
[
-0.06936693345179354,
-0.9999999999999998,
-0.006068820300589123,
1880.678313541253
],
[
-9.032152793202284e-05,
0.0,
-7.902109766392087e-06,
0.24762801242350704
]
]
}
\ No newline at end of file
File added
from jsonschema import validate, ValidationError
import json
from pathlib import Path
SHEMA = Path('./thd_json/projection.json')
FILE = Path('./examples/thd_json/test_thd.json')
def main():
with open(str(SHEMA)) as schema_file, open(str(FILE)) as data_file:
schema = json.load(schema_file)
data = json.load(data_file)
try:
validate(instance=data, schema=schema)
print("JSON is valid.")
except ValidationError as e:
print("Validation error:", e)
if __name__ == '__main__':
main()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment