OverviewDockWidget

class prism._gui.widgets.OverviewDockWidget(main_window_obj, *args, **kwargs)[source]

Defines the OverviewDockWidget class for the Projection GUI.

This class provides the user with the ability to quickly create; draw; view; and save projection figures.

__init__(main_window_obj, *args, **kwargs)[source]

Initialize an instance of the OverviewDockWidget class.

Parameters:

main_window_obj (MainViewerWindow object) – Instance of the MainViewerWindow class that acts as the parent of this dock widget.

Other Parameters:
 
  • args (positional arguments) – The positional arguments that must be passed to the constructor of the QDockWidget class.
  • kwargs (keyword arguments) – The keyword arguments that must be passed to the constructor of the QDockWidget class.
_create_projection_figure(list_item)[source]

Creates the projection figure requested in the provided list_item, calculating its projection data.

This function is used iteratively by create_projection_figures().

Parameters:list_item (QListWidgetItem object) – The item that contains the requested projection figure.
_details_projection_figure(list_item)[source]

Creates and shows a details dialog for the projection figure requested in the provided list_item.

Parameters:list_item (QListWidgetItem object) – The item that contains the requested projection figure.
_draw_projection_figure(list_item)[source]

Draws the projection figure requested in the provided list_item, creating its Figure instance.

This function is used iteratively by draw_projection_figures().

Parameters:list_item (QListWidgetItem object) – The item that contains the requested projection figure.
closeEvent(*args, **kwargs)[source]

Special closeEvent() event that automatically performs some clean-up operations before the overview dock widget closes.

close_projection_figures(list_items=None)[source]

Retrieves the projection figures requested in the provided list_items and closes their Figure objects.

This function acts as a Qt slot.

Other Parameters:
 list_items (list of QListWidgetItem objects or None. Default: None) – The list of items that contains the requested projection figures. If None, all currently selected list items are used instead.
create_available_context_menu()[source]

Creates the context (right-click) menu for the ‘Available’ overview list.

This menu contains all actions that are available for created (but not drawn) projection figures.

create_draw_projection_figures(list_items=None)[source]

Retrieves the projection figures requested in the provided list_items, calculates their projection data and draws their Figure objects afterward.

This function is basically a combination of create_projection_figures() and draw_projection_figures().

This function acts as a Qt slot.

Other Parameters:
 list_items (list of QListWidgetItem objects or None. Default: None) – The list of items that contains the requested projection figures. If None, all currently selected list items are used instead.
create_draw_save_projection_figures(list_items=None)[source]

Retrieves the projection figures requested in the provided list_items, calculates their projection data, draws their Figure objects and saves them afterward.

This function is basically a combination of create_projection_figures(); draw_projection_figures() and save_projection_figures().

This function acts as a Qt slot.

Other Parameters:
 list_items (list of QListWidgetItem objects or None. Default: None) – The list of items that contains the requested projection figures. If None, all currently selected list items are used instead.
create_drawn_context_menu()[source]

Creates the context (right-click) menu for the ‘Drawn’ overview list.

This menu contains all actions that are available for drawn projection figures.

create_projection_figures(list_items=None)[source]

Retrieves the projection figures requested in the provided list_items and creates them, calculating their corresponding projection data.

This function acts as a Qt slot.

Other Parameters:
 list_items (list of QListWidgetItem objects or None. Default: None) – The list of items that contains the requested projection figures. If None, all currently selected list items are used instead.
create_unavailable_context_menu()[source]

Creates the context (right-click) menu for the ‘Unavailable’ overview list.

This menu contains all actions that are available for non-existing projection figures.

delete_projection_figures(list_items=None, *, skip_warning=False)[source]

Retrieves the projection figures requested in the provided list_items and delete them, permanently removing their corresponding projection data.

This function acts as a Qt slot.

Other Parameters:
 
  • list_items (list of QListWidgetItem objects or None. Default: None) – The list of items that contains the requested projection figures. If None, all currently selected list items are used instead.
  • skip_warning (bool. Default: False) – Whether or not to skip showing the warning asking the user if they are sure they want to permanently delete all items in list_items. If True, the answer is taken to be True.
details_available_projection_figure(list_item=None)[source]

Retrieves the projection figure requested in the provided list_item, gathers its properties and shows a details dialog listing them.

This function is used for projections in the ‘Available’ list.

This function acts as a Qt slot.

Other Parameters:
 list_item (QListWidgetItem object or None. Default: None) – The item that contains the requested projection figure. If None, the currently selected list item is used instead.
details_drawn_projection_figure(list_item=None)[source]

Retrieves the projection figure requested in the provided list_item, gathers its properties and shows a details dialog listing them.

This function is used for projections in the ‘Drawn’ list.

This function acts as a Qt slot.

Other Parameters:
 list_item (QListWidgetItem object or None. Default: None) – The item that contains the requested projection figure. If None, the currently selected list item is used instead.
draw_projection_figures(list_items=None)[source]

Retrieves the projection figures requested in the provided list_items and draws them, creating their Figure instances.

If the auto_show option is True, drawn figures will be shown automatically as well.

This function acts as a Qt slot.

Other Parameters:
 list_items (list of QListWidgetItem objects or None. Default: None) – The list of items that contains the requested projection figures. If None, all currently selected list items are used instead.
draw_save_projection_figures(list_items=None)[source]

Retrieves the projection figures requested in the provided list_items, draws their Figure objects and saves them afterward.

This function is basically a combination of draw_projection_figures() and save_projection_figures().

This function acts as a Qt slot.

Other Parameters:
 list_items (list of QListWidgetItem objects or None. Default: None) – The list of items that contains the requested projection figures. If None, all currently selected list items are used instead.
init()[source]

Sets up the projection overview dock widget after it has been initialized.

This function is mainly responsible for creating the different overview lists and menus that allow the user to manipulate projection figures.

recreate_projection_figures(list_items=None)[source]

Retrieves the projection figures requested in the provided list_items and recreates them, permanently removing their corresponding projection data and recalculating it.

This function is basically a combination of delete_projection_figures() and create_projection_figures().

This function acts as a Qt slot.

Other Parameters:
 list_items (list of QListWidgetItem objects or None. Default: None) – The list of items that contains the requested projection figures. If None, all currently selected list items are used instead.
redraw_projection_figures(list_items=None)[source]

Retrieves the projection figures requested in the provided list_items and redraws them, closing and recreating their Figure objects.

This function is basically a combination of close_projection_figures() and draw_projection_figures().

This function acts as a Qt slot.

Other Parameters:
 list_items (list of QListWidgetItem objects or None. Default: None) – The list of items that contains the requested projection figures. If None, all currently selected list items are used instead.
save_as_projection_figures(list_items=None)[source]

Retrieves the projection figures requested in the provided list_items and saves their Figure objects, asking the user where to save each one.

This function basically calls save_projection_figures() with choose set to True.

This function acts as a Qt slot.

Other Parameters:
 list_items (list of QListWidgetItem objects or None. Default: None) – The list of items that contains the requested projection figures. If None, all currently selected list items are used instead.
save_projection_figures(list_items=None, *, choose=False)[source]

Retrieves the projection figures requested in the provided list_items and saves their Figure objects.

This function acts as a Qt slot.

Other Parameters:
 
  • list_items (list of QListWidgetItem objects or None. Default: None) – The list of items that contains the requested projection figures. If None, all currently selected list items are used instead.
  • choose (bool. Default: False) – Whether or not the user is allowed to choose where the projection figure is saved to. If False, it uses the default filename as defined by _Projection__get_fig_path().
show_available_context_menu()[source]

Shows the ‘Available’ context menu, giving the user access to its actions.

This function acts as a Qt slot.

show_drawn_context_menu()[source]

Shows the ‘Drawn’ context menu, giving the user access to its actions.

This function acts as a Qt slot.

show_projection_figures(list_items=None)[source]

Retrieves the projection figures requested in the provided list_items and shows them in the projection viewing area.

This function acts as a Qt slot.

Other Parameters:
 list_items (list of QListWidgetItem objects or None. Default: None) – The list of items that contains the requested projection figures. If None, all currently selected list items are used instead.
show_unavailable_context_menu()[source]

Shows the ‘Unavailable’ context menu, giving the user access to its actions.

This function acts as a Qt slot.

use_progress_dialog(label, func, *iterables)[source]

Creates a progress dialog with the given label, and executes the requested func using the provided iterables.

Depending on the current settings, this function will either create a ThreadedProgressDialog object that allows the user to abort the operation (but is slower), or a static dialog that cannot be interrupted.

Parameters:
  • label (str) – The label that is used as the description of what operation is currently being executed.
  • func (function) – The function that must be called iteratively using the arguments provided in iterables.
  • iterables (positional arguments) – All iterables that must be used to call func with.
Returns:

result (bool) – Whether or not the operations ended successfully, which can be used by other functions to determine if it should continue.