Skip to content

Commit

Permalink
Call the function rather than simulate a click
Browse files Browse the repository at this point in the history
  • Loading branch information
po09i committed Sep 12, 2023
1 parent b512777 commit 1cbd3d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions fsleyes_plugin_shimming_toolbox/components/run_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ def button_run_on_click(self, event):
Calls the relevant ``Shimming Toolbox`` CLI command (``st_function``) in a thread
"""
self.run()

def run(self):
if not self.worker:
try:
command, msg = self.get_run_args(self.st_function)
Expand Down
5 changes: 3 additions & 2 deletions fsleyes_plugin_shimming_toolbox/tabs/dicom_to_nifti_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def __init__(self, parent, title="Dicom to Nifti"):
super().__init__(parent, title, description)

self.sizer_run = self.create_sizer_run()
self.run_component = None
sizer = self.create_dicom_to_nifti_sizer()
self.sizer_run.Add(sizer, 0, wx.EXPAND)

Expand Down Expand Up @@ -52,5 +53,5 @@ def create_dicom_to_nifti_sizer(self):
}
]
component = InputComponent(self, input_text_box_metadata, cli=dicom_to_nifti_cli)
run_component = RunComponent(panel=self, list_components=[component], st_function="st_dicom_to_nifti")
return run_component.sizer
self.run_component = RunComponent(panel=self, list_components=[component], st_function="st_dicom_to_nifti")
return self.run_component.sizer

0 comments on commit 1cbd3d4

Please sign in to comment.