Skip to content

Commit 6f3ea34

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

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

OpenLIFULib/OpenLIFULib/algorithm_input_widget.py

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

21+
def disable(self, message:str) -> None:
22+
"""Disable and set a message in the combobox."""
23+
self.combo_box.addItem(message)
24+
self.combo_box.setCurrentText(message)
25+
self.combo_box.setDisabled(True)
26+
2127
def indicate_no_options(self):
2228
"""Disable and set a message indicating that there are no objects"""
23-
self.combo_box.addItem(f"No {self.name} objects")
24-
self.combo_box.setDisabled(True)
29+
self.disable(f"No {self.name} objects")
2530

2631
class OpenLIFUAlgorithmInputWidget(qt.QWidget):
2732
def __init__(self, algorithm_input_names : List[str], parent=None):

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(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)