Using with napari-micromanager#
If you want a nice GUI to interact with in addition to being able to script you can use napari-micromanager which implements a GUI in napari using this library as a backend.
Launching napari from a script#
For complex scripting you likely will want to launch napari from a script or a jupyter notebook.
from pymmcore_plus import CMMCorePlus
import napari
v = napari.Viewer()
dw, main_window = v.window.add_plugin_dock_widget("napari-micromanager")
mmc = CMMCorePlus.instance()
# do any complicated scripting you want here
...
# start napari
napari.run()
Using the integrated napari terminal#
After launching napari and starting the napari-micromanager
plugin you can open the napari terminal and get a reference to the same core object that the plugin uses by running:
from pymmcore_plus import CMMCorePlus
mmc = CMMCorePlus.instance()