Skip to content

Commit

Permalink
Add grad optimizer and change sequential ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
4rnaudB committed Jun 26, 2024
1 parent c580658 commit e81919e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
39 changes: 31 additions & 8 deletions fsleyes_plugin_shimming_toolbox/tabs/b0shim_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ def create_sizer_dynamic_shim(self, metadata=None):
},
]
component_slice_int = InputComponent(self, input_text_box_metadata_slice, cli=dynamic_cli)
component_slice_seq = InputComponent(self, input_text_box_metadata_slice, cli=dynamic_cli)
component_slice_asc = InputComponent(self, input_text_box_metadata_slice, cli=dynamic_cli)
component_slice_des = InputComponent(self, input_text_box_metadata_slice, cli=dynamic_cli)

output_metadata = [
{
Expand Down Expand Up @@ -277,7 +278,16 @@ def create_sizer_dynamic_shim(self, metadata=None):
]
component_reg_factor_lsq = InputComponent(self, reg_factor_metadata, cli=dynamic_cli)
component_reg_factor_qp = InputComponent(self, reg_factor_metadata, cli=dynamic_cli)


weighting_signal_loss_metadata = [
{
"button_label": "weighting signal loss",
"name": "weighting-signal-loss",
"default_text": "0.01",
},
]
component_slice_w_sig_loss = InputComponent(self, weighting_signal_loss_metadata, cli=dynamic_cli)

criteria_dropdown_metadata = [
{
"label": "Mean Squared Error",
Expand All @@ -290,15 +300,23 @@ def create_sizer_dynamic_shim(self, metadata=None):
{
"label": "Root Mean Squared Error",
"option_value": "rmse",
},
{
"label": "Mean Squared Error + Z gradient",
"option_value": "grad",
}
]
]

dropdown_crit = DropdownComponent(
panel=self,
dropdown_metadata=criteria_dropdown_metadata,
label="Optimizer Criteria",
option_name='optimizer-criteria',
cli=dynamic_cli
cli=dynamic_cli,
list_components=[self.create_empty_component(),
self.create_empty_component(),
self.create_empty_component(),
component_slice_w_sig_loss]
)

dropdown_opt_metadata = [
Expand Down Expand Up @@ -335,8 +353,12 @@ def create_sizer_dynamic_shim(self, metadata=None):
"option_value": "auto"
},
{
"label": "Sequential",
"option_value": "sequential"
"label": "Ascending",
"option_value": "ascending"
},
{
"label": "Descending",
"option_value": "descending"
},
{
"label": "Interleaved",
Expand All @@ -345,7 +367,7 @@ def create_sizer_dynamic_shim(self, metadata=None):
{
"label": "Volume",
"option_value": "volume"
},
}
]

self.dropdown_slice_dyn = DropdownComponent(
Expand All @@ -355,7 +377,8 @@ def create_sizer_dynamic_shim(self, metadata=None):
cli=dynamic_cli,
option_name='slices',
list_components=[self.create_empty_component(),
component_slice_seq,
component_slice_asc,
component_slice_des,
component_slice_int,
self.create_empty_component()]
)
Expand Down
2 changes: 1 addition & 1 deletion installer/install_shimming_toolbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rm -rf "${ST_DIR}/shimming-toolbox"

print info "Downloading Shimming-Toolbox"

ST_VERSION="cf28d353240fd510de1e8aa492c6c23ae57e66bd"
ST_VERSION="e136db64e0cf9110adf321a1adc957453009f475"

curl -L "https://github.com/shimming-toolbox/shimming-toolbox/archive/${ST_VERSION}.zip" > "shimming-toolbox-${ST_VERSION}.zip"

Expand Down

0 comments on commit e81919e

Please sign in to comment.