napari_spatialdata.Interactive#

class napari_spatialdata.Interactive(sdata, headless=False)#

Interactive visualization of spatial data.

Parameters:
sdata SpatialData | list[SpatialData]

SpatialData object.

headless bool (default: False)

Run napari in headless mode, default False.

Returns:

None

Methods table#

add_element(element, element_coordinate_system)

Add an element of a spatial data object being visualized with interactive to the viewer.

run()

Run the napari application.

screenshot()

Take a screenshot of the viewer in its current state.

switch_coordinate_system(coordinate_system)

Switch to a coordinate system present in the spatialdata object(s).

Methods#

add_element#

Interactive.add_element(element, element_coordinate_system, view_element_system=False)#

Add an element of a spatial data object being visualized with interactive to the viewer.

Parameters:
element str

The name of the element in the spatial data object to add as napari layer.

element_coordinate_system str

The coordinate system in which the layer should be visualized.

view_element_system bool (default: False)

Whether to switch to element_coordinate_system or to switch back to current active coordinate system after adding an element as layer.

Return type:

None

run#

Interactive.run()#

Run the napari application.

Return type:

None

screenshot#

Interactive.screenshot()#

Take a screenshot of the viewer in its current state.

Return type:

Union[ndarray[Any, dtype[Any]], Any]

switch_coordinate_system#

Interactive.switch_coordinate_system(coordinate_system)#

Switch to a coordinate system present in the spatialdata object(s).

Return type:

None