From 4f144df4aec4dcf0e35763e7ce7dc4b2f47ef0f4 Mon Sep 17 00:00:00 2001 From: Andras Lasso Date: Thu, 10 Sep 2026 08:03:27 -0400 Subject: [PATCH] BUG: Fix aneurysm repeating-timer callback argument mismatch The repeating deformation timer (hold 'd') called deform_mesh_aneurysm with only sharpness and force scale, but the method also requires the target aneurysm radius, so the timer path raised TypeError on every tick. Store the target radius as an interactor attribute (initialized from ANEURYSM_MAX_RADIUS_DEFAULT_CM like the other deformation parameters and refreshed on every deform_mesh_aneurysm call) and pass it from the timer callback. Co-Authored-By: Claude Fable 5 --- svmorph/visualization/interactor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/svmorph/visualization/interactor.py b/svmorph/visualization/interactor.py index e47995d1..5e948530 100644 --- a/svmorph/visualization/interactor.py +++ b/svmorph/visualization/interactor.py @@ -27,6 +27,7 @@ from svmorph.core import mesh_data from svmorph.core.units import L, unit_name from svmorph.core.defaults import ( + ANEURYSM_MAX_RADIUS_DEFAULT_CM, STENT_DIAMETER_DEFAULT_CM, STENT_LENGTH_DEFAULT_CM, SMOOTHING_K_CM, @@ -102,6 +103,7 @@ def __init__(self, mesh, centerline, mesh_filename, centerline_filename, mesh_ac self.sharpness = 1.0 self.force_scale = -1.0 + self.aneurysm_radius = ANEURYSM_MAX_RADIUS_DEFAULT_CM * L() self.stent_radius = (STENT_DIAMETER_DEFAULT_CM / 2) * L() self.stent_length = STENT_LENGTH_DEFAULT_CM * L() self.smoothing_k = SMOOTHING_K_CM * L() @@ -132,7 +134,7 @@ def key_press_event(self, obj, event): def timer_callback(self, obj, event): """Repeating timer callback that drives one sequential deformation step.""" - self.deform_mesh_aneurysm(self.sharpness, self.force_scale) + self.deform_mesh_aneurysm(self.sharpness, self.force_scale, self.aneurysm_radius) def key_release_event(self, obj, event): """Handle key-release events. Releasing 'd' destroys the deformation timer.""" @@ -469,6 +471,8 @@ def lock_camera(self, position): def deform_mesh_aneurysm(self, sharpness, force_scale, aneurysm_radius): """Run one step of the aneurysm deformation pipeline.""" + # Remember the target so the repeating-timer path continues with the latest value + self.aneurysm_radius = aneurysm_radius if len(self.selected_points) < 1: logger.warning("Please select the distal start of the stent along the centerline.") return