From 77f506c89a947cd9112c5332dd0a3f81eeb95e0f Mon Sep 17 00:00:00 2001 From: Chris Bridge Date: Fri, 28 Nov 2025 14:13:45 -0500 Subject: [PATCH 1/2] Increase tolerance used to determine a matrix is orthogonal --- src/highdicom/spatial.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/highdicom/spatial.py b/src/highdicom/spatial.py index 4685e97b1..90d6bf66a 100644 --- a/src/highdicom/spatial.py +++ b/src/highdicom/spatial.py @@ -28,6 +28,10 @@ """Default tolerance on the dot product to determine perpendicularity.""" +_DEFAULT_ORTHOGONAL_TOLERANCE = 1e-4 +"""Default tolerance on the matrix elements to determin orthogonality.""" + + PATIENT_ORIENTATION_OPPOSITES = { PatientOrientationValuesBiped.L: PatientOrientationValuesBiped.R, PatientOrientationValuesBiped.R: PatientOrientationValuesBiped.L, @@ -957,7 +961,7 @@ def get_closest_patient_orientation(affine: np.ndarray) -> tuple[ def _is_matrix_orthogonal( m: np.ndarray, require_unit: bool = True, - tol: float = _DEFAULT_EQUALITY_TOLERANCE, + tol: float = _DEFAULT_ORTHOGONAL_TOLERANCE, ) -> bool: """Check whether a matrix is orthogonal. From 481e466149bec9ee50d6bf6216ae722221565ddb Mon Sep 17 00:00:00 2001 From: Chris Bridge Date: Fri, 28 Nov 2025 14:24:01 -0500 Subject: [PATCH 2/2] Spell fix --- src/highdicom/spatial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/highdicom/spatial.py b/src/highdicom/spatial.py index 90d6bf66a..5ee7be998 100644 --- a/src/highdicom/spatial.py +++ b/src/highdicom/spatial.py @@ -29,7 +29,7 @@ _DEFAULT_ORTHOGONAL_TOLERANCE = 1e-4 -"""Default tolerance on the matrix elements to determin orthogonality.""" +"""Default tolerance on the matrix elements to determine orthogonality.""" PATIENT_ORIENTATION_OPPOSITES = {