diff --git a/README.md b/README.md index 8d5d04d0e67b2759464672b9f0acd0df84c4037b..e0d3ab963c5c78c76822abfa2eb80b0996b10ca4 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,7 @@ def get_projection_dict( image_dimensions_px: np.ndarray, pixel_pitch_mm: np.ndarray, header: JsonHeader | None = None, + focal_spot_orientation_quat: np.ndarray | None = None, ): if header is None: header = generate_header() @@ -144,10 +145,11 @@ def get_projection_dict( detector_center_position_mm, detector_center_orientation_quat, header, + focal_spot_orientation_quat, ) 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 diff --git a/pyproject.toml b/pyproject.toml index 5cc49e0fc255362ce7c0f423463ec2092b4b6135..2b411108e81c247176850e3cab06ebac355fcd1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "thd-json" -version = "0.1.9" +version = "0.1.10" description = "THD JSON schema and validation tools." authors = [ { name = "swittl", email = "simon.wittl@th-deg.de" } diff --git a/src/thd_json/projection/__init__.py b/src/thd_json/projection/__init__.py index 0c4b663578e3617c5387f1648544b7002543dbfd..53e4482ce228f9cc59f5ea9efa38931be2db9cf9 100644 --- a/src/thd_json/projection/__init__.py +++ b/src/thd_json/projection/__init__.py @@ -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.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 import argparse import numpy as np -import numpy as np def get_projection_validator(json_suffix: str = "*.json") -> Validator: @@ -49,7 +44,7 @@ def get_projection_dict( image_dimensions_px: np.ndarray, pixel_pitch_mm: np.ndarray, header: JsonHeader | None = None, - focal_spot_orientation_quat: np.ndarray | None = None + focal_spot_orientation_quat: np.ndarray | None = None, ): if header is None: header = generate_header() @@ -60,13 +55,14 @@ def get_projection_dict( detector_center_position_mm, detector_center_orientation_quat, header, - focal_spot_orientation_quat + focal_spot_orientation_quat, ) - projection['detector'] = get_detector_dict(image_dimensions_px, pixel_pitch_mm) - projection['image'] = {'image_path': str(image_path)} + projection["detector"] = get_detector_dict(image_dimensions_px, pixel_pitch_mm) + projection["image"] = {"image_path": str(image_path)} return projection + if __name__ == "__main__": projection_cli() diff --git a/src/thd_json/projection/projection.json b/src/thd_json/projection/projection.json index c24ae7cf0712065e5748caeb3ad1de3f9f1651e3..90a404f8b6786cbba5801cc92dc8ecdc9edada15 100644 --- a/src/thd_json/projection/projection.json +++ b/src/thd_json/projection/projection.json @@ -11,7 +11,8 @@ "projection_geometry": { "$ref": "./projection_geometry/projection_geometry.json" }, - "projection_geometry_nominal": { + "projection_geometry_nominal": + { "$ref": "./projection_geometry/projection_geometry.json" }, "detector": { diff --git a/src/thd_json/projection_geometry/__init__.py b/src/thd_json/projection_geometry/__init__.py index de1571f72f7535c1c49d8064fbf4a3b304b1f565..b0884b6d4425af5a0949d451e2dca2f8112757b1 100644 --- a/src/thd_json/projection_geometry/__init__.py +++ b/src/thd_json/projection_geometry/__init__.py @@ -45,7 +45,7 @@ def get_projection_geometry_dict( detector_center_position_mm: np.ndarray, detector_center_orientation_quat: np.ndarray, header: JsonHeader | None = None, - focal_spot_orientation_quat: np.ndarray | None = None + focal_spot_orientation_quat: np.ndarray | None = None, ): if header is None: header = generate_header() diff --git a/src/thd_json/projection_geometry/projection_geometry.json b/src/thd_json/projection_geometry/projection_geometry.json index 2dd8a132a11e6667b42a314851f83f4f474a6084..87870b18d84fe24ff76d89872d34d7acc8ddb34d 100644 --- a/src/thd_json/projection_geometry/projection_geometry.json +++ b/src/thd_json/projection_geometry/projection_geometry.json @@ -170,6 +170,7 @@ "required": [ "header", "focal_spot_position_mm", + "focal_spot_orientation_quat", "detector_center_position_mm", "detector_center_orientation_quat" ],