Skip to content

Commit

Permalink
Added error message when no images selected
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorTatarnikov committed Jan 16, 2024
1 parent 20b97f7 commit 35b24bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions brainglobe_registration/registration_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from bg_atlasapi import BrainGlobeAtlas
from bg_atlasapi.list_atlases import get_downloaded_atlases
from brainglobe_utils.qtpy.collapsible_widget import CollapsibleWidgetContainer
from napari.utils.notifications import show_error
from napari.viewer import Viewer
from qtpy.QtWidgets import (
QPushButton,
Expand Down Expand Up @@ -315,3 +316,8 @@ def _on_scale_moving_image(self, x: float, y: float):
preserve_range=True,
anti_aliasing=True,
)
else:
show_error(

Check warning on line 320 in brainglobe_registration/registration_widget.py

View check run for this annotation

Codecov / codecov/patch

brainglobe_registration/registration_widget.py#L320

Added line #L320 was not covered by tests
"No sample image or atlas selected. "
"Please select a sample image and atlas before scaling",
)
2 changes: 2 additions & 0 deletions brainglobe_registration/widgets/adjust_moving_image_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ def __init__(self, parent=None):
rotation_range = 360

self.adjust_moving_image_voxel_size_x = QDoubleSpinBox(parent=self)
self.adjust_moving_image_voxel_size_x.setDecimals(5)
self.adjust_moving_image_voxel_size_y = QDoubleSpinBox(parent=self)
self.adjust_moving_image_voxel_size_y.setDecimals(5)
self.scale_moving_image_button = QPushButton()
self.scale_moving_image_button.setText("Scale Image")
self.scale_moving_image_button.clicked.connect(
Expand Down

0 comments on commit 35b24bd

Please sign in to comment.