Skip to content

Commit

Permalink
bug fix (#67)
Browse files Browse the repository at this point in the history
* bug fix

* modifies tests to make sure scanner-coil-order checkboxes work
  • Loading branch information
4rnaudB authored Mar 6, 2024
1 parent 8718b6a commit a832250
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def get_argument(self, checkboxes):
if checkbox.GetValue():
label = checkbox.GetLabel()
args += option_values[label] + ','
if args == "":
return "-1"

return args[:-1]

def get_command(self):
Expand Down
23 changes: 19 additions & 4 deletions test/gui/test_b0shim_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_st_plugin_b0shim_dyn_lsq_mse():
options = {'optimizer-method': 'Least Squares',
'optimizer-criteria': 'Mean Squared Error',
'slices': 'Auto detect',
'scanner-coil-order': '0',
'scanner-coil-order': 'f0',
'output-file-format-scanner': 'Slicewise per Channel',
'output-file-format-coil': 'Slicewise per Channel',
'fatsat': 'Auto detect',
Expand All @@ -46,6 +46,21 @@ def test_st_plugin_b0shim_dyn_lsq_mae():
def _test_st_plugin_b0shim_dyn(view, overlayList, displayCtx, options=options):
__test_st_plugin_b0shim_dyn(view, overlayList, displayCtx, options=options)
run_with_orthopanel(_test_st_plugin_b0shim_dyn)


def test_st_plugin_b0shim_dyn_lsq_mse_coil_only():
options = {'optimizer-method': 'Least Squares',
'optimizer-criteria': 'Mean Absolute Error',
'slices': 'Auto detect',
'scanner-coil-order': '',
'output-file-format-scanner': 'Slicewise per Channel',
'output-file-format-coil': 'Slicewise per Channel',
'output-value-format': 'delta'
}

def _test_st_plugin_b0shim_dyn(view, overlayList, displayCtx, options=options):
__test_st_plugin_b0shim_dyn(view, overlayList, displayCtx, options=options)
run_with_orthopanel(_test_st_plugin_b0shim_dyn)


def test_st_plugin_b0shim_dyn_pi():
Expand All @@ -60,8 +75,8 @@ def test_st_plugin_b0shim_dyn_pi():
def _test_st_plugin_b0shim_dyn(view, overlayList, displayCtx, options=options):
__test_st_plugin_b0shim_dyn(view, overlayList, displayCtx, options=options)
run_with_orthopanel(_test_st_plugin_b0shim_dyn)


def test_st_plugin_b0shim_dyn_qp():
options = {'optimizer-method': 'Quad Prog',
'optimizer-criteria': 'Mean Squared Error',
Expand Down Expand Up @@ -133,7 +148,7 @@ def __test_st_plugin_b0shim_dyn(view, overlayList, displayCtx, options):
get_all_children(b0shim_tab.sizer_run, list_widgets)
for widget in list_widgets:
if isinstance(widget, wx.CheckBox) and widget.IsShown():
if widget.GetName() == 'check':
if widget.Label in options['scanner-coil-order']:
assert set_checkbox(widget)

# Select the dropdowns that are nested
Expand Down

0 comments on commit a832250

Please sign in to comment.