From 37e8284278a6efef963385e72c6735cbd4c4b43f Mon Sep 17 00:00:00 2001 From: Simon Wittl <simon.wittl@th-deg.de> Date: Thu, 20 Mar 2025 07:45:43 +0100 Subject: [PATCH] Public --- README.md | 4 +++- pyproject.toml | 2 +- src/thd_json/projection/__init__.py | 14 +++++--------- src/thd_json/projection/projection.json | 3 ++- src/thd_json/projection_geometry/__init__.py | 2 +- .../projection_geometry/projection_geometry.json | 1 + 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 8d5d04d..e0d3ab9 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 5cc49e0..2b41110 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 0c4b663..53e4482 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 c24ae7c..90a404f 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 de1571f..b0884b6 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 2dd8a13..87870b1 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" ], -- GitLab