@@ -46,6 +46,8 @@ def _extraction_params(
4646 extract_summary : bool = True ,
4747 include_fractal : bool = False ,
4848 include_vessel_radius : bool = False ,
49+ junction_cleanup : bool = False ,
50+ cleanup_threshold_factor : float = 2.5 ,
4951 ) -> None :
5052 return None
5153
@@ -56,6 +58,15 @@ def _extraction_params(
5658 extract_branch_text = {"annotation" : bool , "value" : True },
5759 extract_summary = {"annotation" : bool , "value" : True },
5860 include_fractal = {"annotation" : bool , "value" : False },
61+ junction_cleanup = {"annotation" : bool , "value" : False },
62+ cleanup_threshold_factor = {
63+ "annotation" : float ,
64+ "value" : 2.5 ,
65+ "widget_type" : "FloatSpinBox" ,
66+ "min" : 1.0 ,
67+ "max" : 10.0 ,
68+ "step" : 0.1 ,
69+ },
5970 )
6071
6172 # ---------- output parameters (magicgui) ----------
@@ -109,6 +120,15 @@ def _output_params(
109120
110121 advanced_group .append (self .include_vessel_radius_widget )
111122
123+ self .junction_cleanup_widget = extraction_gui .junction_cleanup
124+ self .junction_cleanup_widget .label = "Collapse triangle junction artifacts"
125+
126+ self .cleanup_threshold_widget = extraction_gui .cleanup_threshold_factor
127+ self .cleanup_threshold_widget .label = "Cleanup threshold factor"
128+
129+ advanced_group .append (self .junction_cleanup_widget )
130+ advanced_group .append (self .cleanup_threshold_widget )
131+
112132 # ============================================================
113133 # Output Settings (CLI file export options)
114134 # ============================================================
@@ -172,13 +192,16 @@ def _output_params(
172192 # ------------------------------------------------------------------
173193
174194 def _get_current_pipeline_config (self ) -> PipelineConfig :
195+ junction_cleanup = self .junction_cleanup_widget .value
175196 return PipelineConfig (
176197 extraction = ExtractionConfig (
177198 branches = self .extract_branches_widget .value ,
178199 branch_text = self .extract_branch_text_widget .value ,
179200 summary = self .extract_summary_widget .value ,
180201 fractal_dimension = self .include_fractal_widget .value ,
181202 vessel_radius = self .include_vessel_radius_widget .value ,
203+ junction_cleanup = junction_cleanup ,
204+ cleanup_threshold_factor = self .cleanup_threshold_widget .value ,
182205 ),
183206 output = OutputConfig (
184207 write_skeleton_npy = self .write_skeleton_npy_widget .value ,
@@ -196,6 +219,8 @@ def _set_pipeline_config(self, config: PipelineConfig) -> None:
196219 self .extract_summary_widget .value = e .summary
197220 self .include_fractal_widget .value = e .fractal_dimension
198221 self .include_vessel_radius_widget .value = e .vessel_radius
222+ self .junction_cleanup_widget .value = e .junction_cleanup
223+ self .cleanup_threshold_widget .value = e .cleanup_threshold_factor
199224
200225 o = config .output
201226 self .write_skeleton_npy_widget .value = o .write_skeleton_npy
0 commit comments