add_layer
Add image, labels, points, shapes, vectors, tracks, or surface layers to a napari viewer using file paths or inline data, with options for colormap, blending, size, and colors.
Instructions
Add a layer to the viewer.
Parameters
layer_type : str
One of: "image", "labels", "points", "shapes",
"vectors", "tracks", "surface".
path : str, optional
File path (for image/labels).
data : list, optional
Inline data (coordinates, shape vertices, etc.).
data_var : str, optional
Name of a variable in the execute_code namespace.
name : str, optional
Layer name. Defaults to variable name or filename.
colormap : str, optional
Colormap name (image only).
blending : str, optional
Blending mode (image only).
channel_axis : int, optional
Channel axis (image only).
size : float, optional
Point size in pixels (points only, default 10).
shape_type : str, optional
Shape type: "rectangle", "ellipse", "line", "path", "polygon"
(shapes only, default "rectangle").
edge_color : str, optional
Edge color (shapes/vectors only).
face_color : str, optional
Face color (shapes only).
edge_width : float, optional
Edge width in pixels (shapes/vectors only).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layer_type | Yes | ||
| path | No | ||
| data | No | ||
| data_var | No | ||
| name | No | ||
| colormap | No | ||
| blending | No | ||
| channel_axis | No | ||
| size | No | ||
| shape_type | No | ||
| edge_color | No | ||
| face_color | No | ||
| edge_width | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||