Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To get intellisense tips when writing the script one can write the code inside Napari (need to install the napari_script_editor plugin and then accessing it via the user interface Tools > Scripts > Script editor).

Recording

A simple way to get the syntax of running various commands from a script is to use the Script-Editor together with the Assistant (Plugins > Assistant, need to install the Napari-assistant plugin):

  1. In the Script-Editor check the Record checkbox

  2. In the Assistant navigate to the operation you want to perform

  3. run the operation > the underlying scripting is added to the Script-Editor

Open a new Napari viewer

Code Block
languagepy
import napari  # napari package
viewer = napari.Viewer() # cretae a new napari viewer 

...