Viewer FPS labelΒΆ

Display a 3D volume and the fps label.

Tags: experimental

viewer fps label
/home/runner/work/napari/napari/examples/ FutureWarning: Public access to Window.qt_viewer is deprecated and will be removed in
v0.5.0. It is considered an "implementation detail" of the napari
application, not part of the napari viewer model. If your use case
requires access to qt_viewer, please open an issue to discuss.

import numpy as np
import napari

def update_fps(fps):
    """Update fps."""
    viewer.text_overlay.text = f"{fps:1.1f} FPS"

viewer = napari.Viewer()
viewer.add_image(np.random.random((5, 5, 5)), colormap='red', opacity=0.8)
viewer.text_overlay.visible = True

if __name__ == '__main__':

Gallery generated by Sphinx-Gallery