From 3dc59e2c75be2403203e8d1ad13d3e97e4988d99 Mon Sep 17 00:00:00 2001 From: George Dang <53052793+gtdang@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:09:13 -0400 Subject: [PATCH] fix: removed default scaling and smoothing applied to loaded data dipole --- hnn_core/gui/gui.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/hnn_core/gui/gui.py b/hnn_core/gui/gui.py index 3472a370c..fafef288b 100644 --- a/hnn_core/gui/gui.py +++ b/hnn_core/gui/gui.py @@ -1694,16 +1694,21 @@ def on_upload_data_change(change, data, viz_manager, log_out): _read_dipole_txt(io.StringIO(ext_content), file_extension) ]} logger.info(f'External data {data_fname} loaded.') + + # Create a dipole plot _template_name = "[Blank] single figure" viz_manager.reset_fig_config_tabs(template_name=_template_name) viz_manager.add_figure() fig_name = _idx2figname(viz_manager.data['fig_idx']['idx'] - 1) - ax_plots = [("ax0", "current dipole")] - - # these lines plot the data per axis - for ax_name, plot_type in ax_plots: - viz_manager._simulate_edit_figure( - fig_name, ax_name, data_fname, plot_type, {}, "plot") + process_configs = {'dipole_smooth': 0, 'dipole_scaling': 1} + viz_manager._simulate_edit_figure(fig_name, + ax_name='ax0', + simulation_name=data_fname, + plot_type="current dipole", + preprocessing_config=process_configs, + operation='plot' + ) + # Reset the load file widget change['owner'].value = []