Viewer Modules¶
Batch Manager¶
-
class
mesmerize.viewer.modules.batch_manager.
ModuleGUI
(parent, run_batch: Optional[list] = None, testing: bool = False)[source]¶ GUI for the Batch Manager
-
__init__
(parent, run_batch: Optional[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
- Parameters
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.
- Returns
UUID of the added item
-
del_item
()[source]¶ Delete the currently selected item from the batch and any corresponding dependents of the item’s output
-
df
¶ 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
-
get_selected_items
() → Tuple[List[int], List[uuid.UUID]][source]¶ Returns a list of numeric indices and uuids for the currently selected items
-
load_item_input
(viewers: Union[mesmerize.viewer.main_window.MainWindow, collections.UserList], r: pandas.core.series.Series = None, UUID: uuid.UUID = None, *args)[source]¶ Pass either the batch DataFrame row or UUID of the item of which to load the input into a viewer
- Parameters
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()
- Parameters
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 output 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
- Parameters
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
-
Tiff Module¶
Uses the tifffile package created by Christoph Gohlke: https://pypi.org/project/tifffile/
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]¶ -
check_meta_path
() → bool[source]¶ check if a file exists with the same name and the meta data extension specified by the selected meta data format
-
load
(tiff_path: str, method: str, axes_order: Optional[str] = None, meta_path: Optional[str] = None, meta_format: Optional[str] = None) → mesmerize.viewer.core.viewer_work_environment.ViewerWorkEnv[source]¶ Load a tiff file along with associated meta data
- Parameters
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” usestifffile.imread()
axes_order – axes order, examples: txy, xyt, tzxy, xytz etc.
meta_format – name of function from viewer.core.organize_meta that should be used to organize the meta data.
-
Caiman Motion Correction¶
Front-end for Caiman NoRMCorre parameters entry
Can be used with scripts for adding batch items.
See also
CNMF¶
Front-end for Caiman CNMF parameter entry
Can be used with scripts for adding batch items.
See also
-
class
mesmerize.viewer.modules.cnmf.
ModuleGUI
(parent, viewer_reference)[source]¶
CNMFE¶
Front-end for Caiman CNMFE parameter entry
Can be used with scripts for adding batch items.
See also
-
class
mesmerize.viewer.modules.cnmfe.
ModuleGUI
(parent, viewer_reference)[source]¶ -
get_params
(item_type: str, group_params: bool = False) → dict[source]¶ Get a dict of the set parameters. If the work environment was loaded from a motion correction batch item it put the bord_px in the dict. Doesn’t use any arguments
- Parameters
item_type – one of corr_pnr or cnmfe
-
MESc Importer¶
MESc importer for exploring & importing image sequences from .mesc HDF5 files.
ModuleGUI¶
-
class
mesmerize.viewer.modules.femtonics_mesc.
ModuleGUI
(parent, viewer_ref)[source]¶ instance of
MEScNavigator
-
plot_widgets
¶ list of plot widgets
-
set_file
(path: str, *args)[source]¶ Create an h5py file handle from the .mesc file at the given
path
.*args are not used, its just there for compatibility with the decorator.
- Parameters
path (str) – path to the .mes file
args – not used