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

Merge branch 'public' into 'main'

Public

See merge request roboct/definitions/json_schemas!17
parents 4516ec68 37e82842
No related branches found
No related tags found
No related merge requests found
...@@ -134,6 +134,7 @@ def get_projection_dict( ...@@ -134,6 +134,7 @@ def get_projection_dict(
image_dimensions_px: np.ndarray, image_dimensions_px: np.ndarray,
pixel_pitch_mm: np.ndarray, pixel_pitch_mm: np.ndarray,
header: JsonHeader | None = None, header: JsonHeader | None = None,
focal_spot_orientation_quat: np.ndarray | None = None,
): ):
if header is None: if header is None:
header = generate_header() header = generate_header()
...@@ -144,10 +145,11 @@ def get_projection_dict( ...@@ -144,10 +145,11 @@ def get_projection_dict(
detector_center_position_mm, detector_center_position_mm,
detector_center_orientation_quat, detector_center_orientation_quat,
header, header,
focal_spot_orientation_quat,
) )
projection["detector"] = get_detector_dict(image_dimensions_px, pixel_pitch_mm) projection["detector"] = get_detector_dict(image_dimensions_px, pixel_pitch_mm)
projection["image"] = {"image_path", str(image_path)} projection["image"] = {"image_path": str(image_path)}
return projection return projection
......
[project] [project]
name = "thd-json" name = "thd-json"
version = "0.1.9" version = "0.1.10"
description = "THD JSON schema and validation tools." description = "THD JSON schema and validation tools."
authors = [ authors = [
{ name = "swittl", email = "simon.wittl@th-deg.de" } { name = "swittl", email = "simon.wittl@th-deg.de" }
......
...@@ -3,15 +3,10 @@ from thd_json.header import JsonHeader, generate_header ...@@ -3,15 +3,10 @@ from thd_json.header import JsonHeader, generate_header
from thd_json.projection_geometry import get_projection_geometry_dict from thd_json.projection_geometry import get_projection_geometry_dict
from thd_json.detector import get_detector_dict from thd_json.detector import get_detector_dict
from thd_json.header import JsonHeader, generate_header
from thd_json.projection_geometry import get_projection_geometry_dict
from thd_json.detector import get_detector_dict
from pathlib import Path from pathlib import Path
import argparse import argparse
import numpy as np import numpy as np
import numpy as np
def get_projection_validator(json_suffix: str = "*.json") -> Validator: def get_projection_validator(json_suffix: str = "*.json") -> Validator:
...@@ -49,7 +44,7 @@ def get_projection_dict( ...@@ -49,7 +44,7 @@ def get_projection_dict(
image_dimensions_px: np.ndarray, image_dimensions_px: np.ndarray,
pixel_pitch_mm: np.ndarray, pixel_pitch_mm: np.ndarray,
header: JsonHeader | None = None, header: JsonHeader | None = None,
focal_spot_orientation_quat: np.ndarray | None = None focal_spot_orientation_quat: np.ndarray | None = None,
): ):
if header is None: if header is None:
header = generate_header() header = generate_header()
...@@ -60,13 +55,14 @@ def get_projection_dict( ...@@ -60,13 +55,14 @@ def get_projection_dict(
detector_center_position_mm, detector_center_position_mm,
detector_center_orientation_quat, detector_center_orientation_quat,
header, header,
focal_spot_orientation_quat focal_spot_orientation_quat,
) )
projection['detector'] = get_detector_dict(image_dimensions_px, pixel_pitch_mm) projection["detector"] = get_detector_dict(image_dimensions_px, pixel_pitch_mm)
projection['image'] = {'image_path': str(image_path)} projection["image"] = {"image_path": str(image_path)}
return projection return projection
if __name__ == "__main__": if __name__ == "__main__":
projection_cli() projection_cli()
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
"projection_geometry": { "projection_geometry": {
"$ref": "./projection_geometry/projection_geometry.json" "$ref": "./projection_geometry/projection_geometry.json"
}, },
"projection_geometry_nominal": { "projection_geometry_nominal":
{
"$ref": "./projection_geometry/projection_geometry.json" "$ref": "./projection_geometry/projection_geometry.json"
}, },
"detector": { "detector": {
......
...@@ -45,7 +45,7 @@ def get_projection_geometry_dict( ...@@ -45,7 +45,7 @@ def get_projection_geometry_dict(
detector_center_position_mm: np.ndarray, detector_center_position_mm: np.ndarray,
detector_center_orientation_quat: np.ndarray, detector_center_orientation_quat: np.ndarray,
header: JsonHeader | None = None, header: JsonHeader | None = None,
focal_spot_orientation_quat: np.ndarray | None = None focal_spot_orientation_quat: np.ndarray | None = None,
): ):
if header is None: if header is None:
header = generate_header() header = generate_header()
......
...@@ -170,6 +170,7 @@ ...@@ -170,6 +170,7 @@
"required": [ "required": [
"header", "header",
"focal_spot_position_mm", "focal_spot_position_mm",
"focal_spot_orientation_quat",
"detector_center_position_mm", "detector_center_position_mm",
"detector_center_orientation_quat" "detector_center_orientation_quat"
], ],
......
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