Nico O.
Nico O.

Reputation: 41

napari: RuntimeError: wrapped C/C++ object of type QtLayerListModel has been deleted

I am trying to open an image using napari as an image viewer for python. The image is of format tiff and for some reason I keep getting the same error: RuntimeError: wrapped C/C++ object of type QtLayerListModel has been deleted.

Here is my code, any idea of what I can do to solve it?:

%gui qt5
from skimage import data
import napari
from tifffile import imread, imwrite

newImg = imread('labels_nucleus.tif')

viewer.add_image(newImg)

Upvotes: 1

Views: 129

Answers (1)

Anna Kotova
Anna Kotova

Reputation: 1

Not sure why this mistake occurs but simply converting images to NumPy arrays after reading worked for me.

Upvotes: 0

Related Questions