Plot Bases

AbstractBasePlotWidget

class mesmerize.plotting.widgets.base._AbstractBasePlotWidget[source]
transmission

The input transmission

Return type:Transmission
set_input(transmission: mesmerize.analysis.data_types.Transmission)[source]

Set the input Transmission with data to plot

Parameters:transmission – Input transmission
update_plot(*args, **kwargs)[source]

Method that must must be used for updating the plot

get_plot_opts() → dict[source]

Package all necessary plot parameters that in combination with the transmission property are sufficient to restore the plot

set_plot_opts(opts: dict)[source]

Set plot parameters from a dict in the format returned by get_plot_opts()

save_plot(*args)[source]

Package plot data and plot parameters and save to a file. Must contain all the information that is necessary to restore the plot

open_plot(ptrn_path: str, proj_path: str) → Optional[Tuple[str, str]][source]

Open a plot file and restore the plot

BasePlotWidget

Inherit from this to create interactive plots that can be saved and restored.

class mesmerize.plotting.widgets.base.BasePlotWidget[source]

Bases: mesmerize.plotting.widgets.base._AbstractBasePlotWidget

Base for plot widgets.

Subclasses must define the class attribute “drop_opts” which is used to store a list of JSON incompatible keys returned by the get_plot_opts() method

__init__()[source]

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

block_signals_list = None

List of QObjects included in dynamic signal blocking. Used for storing plot parameter widgets so that changing all of them quickly (like when restoring a plot) doesn’t cause the plot to constantly update.

transmission

The input transmission

Return type:Transmission
set_input(transmission: mesmerize.analysis.data_types.Transmission)[source]

Set the input Transmission with data to plot

Parameters:transmission – Input transmission
update_plot(*args, **kwargs)[source]

Must be implemented in subclass

get_plot_opts(drop: bool) → dict[source]

Must be implemented in subclass

set_plot_opts(opts: dict)[source]

Must be implemented in subclass

classmethod signal_blocker(func)[source]

Use as a decorator. Block Qt signals from all QObjects instances in the block_signals_list

save_plot_dialog(path, *args)[source]

Plot save dialog

save_plot(path)[source]

Save the plot as a Transmission in an HDF5 file. Plot parameters are stored as a JSON string within the HDF5 file. See Transmission.to_hdf5

Parameters:path – Path to save the file to. For easy identification use “.ptrn” extension.
open_plot_dialog(filepath, dirpath, *args, **kwargs)[source]

Open plot dialog

open_plot(ptrn_path: str, proj_path: str) → Optional[Tuple[str, str]][source]

Open a plot saved by the save_plot() method

Parameters:
  • ptrn_path – Path to the HDF5 Transmission file. By convention file extension is “.ptrn”
  • proj_path – Project path of the associated plot data.