Viewer Modules

Batch Manager

class mesmerize.viewer.modules.batch_manager.ModuleGUI(parent, run_batch: list = None, testing: bool = False)[source]

GUI for the Batch Manager

__init__(parent, run_batch: list = None, testing: bool = False)[source]

Initialize self. See help(type(self)) for accurate signature.

add_item(module: str, input_workEnv: mesmerize.viewer.core.viewer_work_environment.ViewerWorkEnv, input_params: dict, name: str = '', info: dict = '') → uuid.UUID[source]

Add an item to the currently open batch

  • module – The module to run from /batch_run_modules.
  • input_workEnv – Input workEnv that the module will use
  • input_params – Input params that the module will use. Depends on your subclass of BatchRunInterface.process() method
  • name – A name for the batch item
  • info – A dictionary with any metadata information to display in the scroll area label.

UUID of the added item

df = None

pandas.DataFrame that stores a “database” of information on the batch

get_item_index(u: Union[uuid.UUID, str]) → int[source]

Get DataFrame index from UUID

Parameters:u – UUID or str representing UUID
Returns:numerical index of the DataFrame corresponding to the UUID
load_item_input(viewers: Union[mesmerize.viewer.main_window.MainWindow, collections.UserList], r: pandas.core.series.Series = None, UUID: uuid.UUID = None)[source]

Pass either the batch DataFrame row or UUID of the item of which to load the input into a viewer

  • viewers – ViewerWindow or list of ImageView
  • r – Row of batch DataFrame corresponding to the selected item
  • UUID – UUID of the item to load input from
load_item_output(module: str, viewers: Union[mesmerize.viewer.main_window.MainWindow, mesmerize.pyqtgraphCore.imageview.ImageView.ImageView, collections.UserList], UUID: uuid.UUID)[source]

Calls subclass of BatchRunInterface.show_output()

  • module – The module name under /batch_run_modules that the batch item is from
  • viewers – ViewerWindow, ImageView, or list of ViewerWindows
  • UUID – UUID of the item to load input from
process_batch(start_ix: Union[int, uuid.UUID] = 0, clear_viewers=False)[source]

Process everything in the batch by calling subclass of BatchRunInterface.process() for all items in batch

  • start_ix – Either DataFrame index (int) or UUID of the item to start from.
  • clear_viewers – Clear work environments in all viewers that are open
show_item_info(s: PyQt5.QtWidgets.QListWidgetItem)[source]

Shows any info (such as the batch module’s params) in the meta-info label

Tiff Module

Can be used with scripts within Mesmerize for loading tiff files without using the API of Viewer Core

class mesmerize.viewer.modules.tiff_io.ModuleGUI(parent, viewer_reference)[source]
load_tiff_file(tiff_path, meta_path, method)[source]

Load a tiff file along with associated meta data

  • tiff_path – path to the tiff file
  • meta_path – path to the json meta data file
  • method – one of “asarray”, “asarray-multi”, or “imread” “asarray” and “asarray-multi” uses tifffile.asarray() “asarray-multi” is for multi-page tiffs “imread” uses tifffile.imread()