Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added stack properties dialog in the Main Window #2465

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

MikeSullivan7
Copy link
Collaborator

@MikeSullivan7 MikeSullivan7 commented Jan 17, 2025

Issue

Closes #2368

Description

Added a custom dialog window which can be accessed by right clicking a stack in the main window and clicking on "Stack properties". This gives information on the stack e.g, Dataset name, File Path, Data type, Memory size, Shape, Log file. More information can be added if needed.

Testing

Make check

Acceptance Criteria

Load a dataset into MI and open the Stack Properties dialog window via the right click window. Check that all the information displayed is correct and that no errors occur

@MikeSullivan7 MikeSullivan7 force-pushed the 2368_stack_properties_menu branch 2 times, most recently from bb53906 to 0402a71 Compare January 20, 2025 17:04
@coveralls
Copy link

coveralls commented Jan 20, 2025

Coverage Status

coverage: 72.489% (-0.2%) from 72.645%
when pulling 98f5b60 on 2368_stack_properties_menu
into fa2343c on main.

@MikeSullivan7 MikeSullivan7 marked this pull request as ready for review January 20, 2025 17:27
@MikeSullivan7 MikeSullivan7 self-assigned this Jan 20, 2025
@MikeSullivan7 MikeSullivan7 changed the title 2368 stack properties menu Added stack properties dialog in the Main Window Jan 20, 2025
@MikeSullivan7 MikeSullivan7 force-pushed the 2368_stack_properties_menu branch from 624db20 to 6f31502 Compare February 18, 2025 15:55
Copy link
Collaborator

@samtygier-stfc samtygier-stfc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get an error if I try to view properties of a 180 projection. I think a case is missing in _get_stack_data_type()

super().__init__(view)

def set_stack_data(self) -> None:
if self.view.stack is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is from a mypy suggestion or older version of the code.
If self.view.stack is None then something has gone wrong (e.g. side bar has got out of sync), so I don't think it should be silently ignored here.

It might be better handled with an assert self.stack is not None in the view, so that the rest of the dialog can assume that it is set. Or this and the call to get_images_by_uuid() could move into the main window.

self.view.stack_shape = self.view.stack.data.shape
self.view.stack_size_MB = self.get_stack_size_MB()

def set_stack_directory(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a -> None

@@ -683,6 +687,10 @@ def _move_stack(self) -> None:
stack_id = self.dataset_tree_widget.selectedItems()[0].id
self.presenter.notify(PresNotification.SHOW_MOVE_STACK_DIALOG, stack_id=stack_id)

def _stack_properties(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a -> None

@@ -109,6 +110,7 @@ class MainWindowView(BaseMainWindowView):
nexus_save_dialog: NexusSaveDialog | None = None
add_to_dataset_dialog: AddImagesToDatasetDialog | None = None
move_stack_dialog: MoveStackDialog | None = None
stack_properties_dialog: StackPropertiesDialog | None = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer needed, I think its left over from when there was a self.stack_properties_dialog

Comment on lines +9 to +10
from mantidimaging.core.data import ImageStack
from mantidimaging.core.data.dataset import Dataset
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These could be in a if TYPE_CHECKING:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stack Properties Menu
3 participants