Skip to content

Commit 1cbc4da

Browse files
Disable target selector during manual VF (#153)
1 parent b23b3f6 commit 1cbc4da

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

OpenLIFULib/OpenLIFULib/algorithm_input_widget.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ class AlgorithmInput:
1818
combo_box : qt.QComboBox
1919
most_recent_selection : Any = None
2020

21+
def disable_with_tooltip(self, tooltip_message:str) -> None:
22+
self.combo_box.setDisabled(True)
23+
self.combo_box.setToolTip(tooltip_message)
24+
2125
def indicate_no_options(self):
2226
"""Disable and set a message indicating that there are no objects"""
2327
self.combo_box.addItem(f"No {self.name} objects")

OpenLIFUPrePlanning/OpenLIFUPrePlanning.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,13 @@ def onVirtualfitClicked(self):
462462
activeData["Protocol"],activeData["Transducer"], activeData["Volume"], activeData["Target"]
463463
)
464464

465-
if virtual_fit_result is None:
465+
if virtual_fit_result is None: # Temporary behavior!
466+
# None indicates for now that the user activated the transform handles to do the placeholder manual virtual fitting.
467+
# It will not be possible to get None once the algorithm is implemented, or at least it wouldn't mean the same thing.
468+
target_id = fiducial_to_openlifu_point_id(activeData["Target"])
469+
self.algorithm_input_widget.inputs_dict["Target"].disable_with_tooltip(f"VF for {target_id} in progress...") # Disable target selector during manual VF
466470
return
471+
self.algorithm_input_widget.update() # Re-enable target-selector now that manual VF is completed. Again, temporary behavior.
467472

468473
self.watchVirtualFit(virtual_fit_result)
469474
self.updateApproveButton()

0 commit comments

Comments
 (0)