mantidimaging.gui.windows.live_viewer.model module#

class mantidimaging.gui.windows.live_viewer.model.ImageWatcher(directory: Path)[source]#

Bases: QObject

A class to watch a directory for new images.

Attributes#

directoryPath

path to directory to watch

watcherQFileSystemWatcher

file system watcher to watch directory

image_changedpyqtSignal

signal emitted when an image is added or removed

Methods#

find_images()

Find all the images in the directory

sort_images_by_modified_time(images)

Sort the images by modified time.

add_sub_directory(sub_dir: SubDirectory)[source]#
clear_deleted_sub_directories(directory: Path)[source]#
find_images(directory: Path) list[Image_Data][source]#

Find all the images in the directory.

find_sub_directories(directory: Path) None[source]#
handle_image_modified(file_path)[source]#
image_changed#

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

recent_image_changed#

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

remove_path()[source]#

Remove the currently set path

remove_sub_directory(sub_dir: Path)[source]#
static sort_images_by_modified_time(images: list[Image_Data]) list[Image_Data][source]#

Sort the images by modified time.

Parameters:

images – list of image objects to sort by modified time

Returns:

sorted list of images

sort_sub_directory_by_modified_time() None[source]#
update_recent_watcher(images: list[Image_Data]) None[source]#
class mantidimaging.gui.windows.live_viewer.model.Image_Data(image_path: Path)[source]#

Bases: object

Image Data Class to store represent image data.

Attributes#

image_pathPath

path to image file

image_namestr

name of image file

image_sizeint

size of image file

image_modified_timefloat

last modified time of image file

property image_modified_time: float#

Return the image modified time

property stat: stat_result#
class mantidimaging.gui.windows.live_viewer.model.LiveViewerWindowModel(presenter: LiveViewerWindowPresenter)[source]#

Bases: object

The model for the spectrum viewer window.

Attributes#

presenterLiveViewerWindowPresenter

presenter for the spectrum viewer window

pathPath

path to dataset

imageslist

list of images in directory

close() None[source]#

Close the model.

handle_image_modified(image_path: Path)[source]#
property path: Path | None#
class mantidimaging.gui.windows.live_viewer.model.SubDirectory(path: Path)[source]#

Bases: object

property modification_time: float#