Skip to content

Commit

Permalink
[fix] fix save table not showing
Browse files Browse the repository at this point in the history
  • Loading branch information
marta-seq committed Jul 10, 2024
1 parent b648fc2 commit e8ac768
Showing 1 changed file with 3 additions and 40 deletions.
43 changes: 3 additions & 40 deletions src/image_widget_all_ch.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,45 +180,6 @@ def plot_comparison_zoom(images_or, imgs_filtered, res_compare, high_contrast):
with self.plot_output_ZOOM:
plot_comparison_zoom([obj[0] for obj in imgs_channel],[obj[0] for obj in imgs_filtered], res, high_contrast)

def _create_dashboard(self):
self.dropdown_ch_name.options = self.channel_names
self.dropdown_image_names.options = [os.path.basename(f) for f in self.files]

# input_widgets = widgets.HBox([self.dropdown_ch_name, self.dropdown_percentile, self.dropdown_th])
# input_widgets_images = widgets.HBox([self.dropdown_sample_images_number, self.dropdown_sample_images])
# input_widgets_images2 = widgets.HBox(
# [self.dropdown_res, self.dropdown_high_constrast_compare])

input_widgets = widgets.HBox([self.dropdown_ch_name, self.dropdown_percentile, self.dropdown_th])

# Create the Display statement
display_statement = widgets.Label(value='Display:')
display_statement.layout.margin = '0px 0px 5px 0px' # Add margin to the bottom

# Create the dropdown widgets for the number of images subset, high contrast, and resolution
display_dropdowns = widgets.HBox([self.dropdown_sample_images_number, self.dropdown_sample_images,
self.dropdown_high_constrast_compare, self.dropdown_res,
self.dropdown_image_names])

# Combine the Display statement and dropdown widgets
display_layout = widgets.VBox([display_statement, display_dropdowns])

tab = widgets.Tab([self.plot_output_images, self.plot_output_histogram, self.plot_output_comparison,
self.plot_output_ZOOM, self.plot_output_psnr])
tab.set_title(0, 'Images')
tab.set_title(1, 'Histogram')
tab.set_title(2, 'Compare images')
tab.set_title(3, 'Compare ZOOM')
tab.set_title(4, 'PSNR')

dashboard_layout = widgets.Layout(height='auto', overflow='auto', flex='1', max_height='100000px')
# dashboard = widgets.VBox([input_widgets, input_widgets_images, input_widgets_images2, tab],
# layout=dashboard_layout)
dashboard = widgets.VBox([input_widgets, display_layout, tab])

display(dashboard)


def update_folder_and_channels(self, folder_path):
self.folder_path = folder_path
self.load_files_from_folder(folder_path)
Expand All @@ -236,7 +197,7 @@ def __init__(self):
# Define widgets
self.btn_saving_options = widgets.Button(description='Saving Options')
self.btn_saving_options.on_click(self._update_output)
self.btn_saving_options.on_click(self._saving_options_eventhandler)
# self.btn_saving_options.on_click(self._saving_options_eventhandler)
self.PATH = widgets.Text(value='path/to/data', description='Original Path:', disabled=False)
# self.button = widgets.Button(description="Change Path")
# self.button.on_click(self._update_output)
Expand Down Expand Up @@ -360,6 +321,8 @@ def _update_output(self, button):
print("Path provided:", directory_path)
self.folder_path = directory_path
self._load_files_from_folder(directory_path)
self._saving_options_eventhandler(button) # Call the method here

else:
print("Error: The specified directory is empty.")
else:
Expand Down

0 comments on commit e8ac768

Please sign in to comment.