diff --git a/app/main.py b/app/main.py index 89cf8e5..b6b169c 100644 --- a/app/main.py +++ b/app/main.py @@ -5,10 +5,7 @@ from app.ui import CustomWidget import os - - def main(): - root = Tk() root.withdraw() @@ -16,8 +13,15 @@ def main(): viewer = napari.Viewer() project_root = os.path.dirname(os.path.dirname(__file__)) - logo_path = os.path.join(project_root, 'assets', 'logo2.png') + bg_logo_path = os.path.join(project_root, 'assets', 'logo.png') + + + if os.path.exists(bg_logo_path): + viewer.open(bg_logo_path, rgb=True, name='Logo') + else: + # print("Logo image not found at:", bg_logo_path) + viewer.add_text("Welcome to GSense", position=(0, 0), color='white', size=24) # Add Save Selected Layer button to the layer list dock widget layer_list_dock = viewer.window._qt_window.findChild(QDockWidget, "layer list") @@ -27,7 +31,7 @@ def main(): layer_list_dock.setVisible(False) layer_controls_dock.setVisible(False) - viewer.window._qt_window.setWindowTitle("Hyperspectral Image Analysis") + viewer.window._qt_window.setWindowTitle("GSense") viewer.window._qt_window.setWindowIcon(QtGui.QIcon(logo_path)) # Add custom widget for batch image loading, spectral mixing, and segmentation @@ -37,4 +41,4 @@ def main(): napari.run() if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/app/ui.py b/app/ui.py index dea28d6..709e888 100644 --- a/app/ui.py +++ b/app/ui.py @@ -259,15 +259,15 @@ def update_button_highlight(self, rgb_idx): for button in self.pseudo_rgb_buttons: button.setStyleSheet("") # Reset to default style - # Highlight the Image button if `rgb_idx` is None (indicating the base image) + # Highlight the Image button if `rgb_idx` is None if rgb_idx is None: - self.hsi_button.setStyleSheet("background-color: orange;") # Highlight style + self.hsi_button.setStyleSheet("background-color: darkgray;") # Highlight style else: self.hsi_button.setStyleSheet("") # Reset the style if not displaying the base image # Highlight the specific pseudo-RGB button if `rgb_idx` is not None if rgb_idx is not None and rgb_idx < len(self.pseudo_rgb_buttons): - self.pseudo_rgb_buttons[rgb_idx].setStyleSheet("background-color: orange;") # Highlight style + self.pseudo_rgb_buttons[rgb_idx].setStyleSheet("background-color: darkgray;") # Highlight style def show_context_menu(self, button, pos, img_idx, rgb_idx): @@ -452,8 +452,8 @@ def show_image_and_mask(self, img_idx, rgb_idx): ######################### ## Functionality based methods - - ### Image loading + + ### Image loading def load_images(self): ''' Load images from file dialog ''' logger.info("User initiated image loading.")