Napari Stuck View in 3D cube

Hi again,

I am running into a strange issue while using the 3D cube view to display an XYZT shape image. My image has the shape (82, 65, 967, 516) TZYX. However somehow the first cube view is stuck on all the other time points.

I execute these lines:

Image = imread(ImageName)
with napari.gui_qt():
    viewer = napari.view_image(Image, name='Raw', rgb=False, scale=[1,1, 0.16, 0.16]) 

Then I change to cube view and this is my first display:

This is the display for a later timepoint:

You can see the “stuck” first cube image, this does not show up when switching off the cube view n getting the hyperstack view with the sliders. Any idea what is going on here? Thanks again guys.



wow, peculiar indeed! would you be able to share the dataset?

curious what happens if you only load a subset of the data into the viewer, for instance with view_image(Image[50:], ...). Does it to the same thing but with the 50th timepoint? or is there anything special about that first timepoint?

Hi tallley, Indeed the same thing happens with [50:], it sticks the first view to all the other views. Could be related to the new update perhaps?

Screenshot with [50:] view_image:



What I figured out is that probably the image is too big so I started reducing the Z to view and this artifact goes away when I give it less Z’s, this one had no artifact:


But Image.shape[1]//3 had it and so did more Z’s.

fascinating, ok thanks for the report! will make an issue for it

wow, this one is a surprise!! not quite sure what’s going on here, I’ll have to look in too!! Curious if you drop the scale arg do weird things still happen? Curious if you go back in time before then do bad things still happen?

Synthetic example:

What is the code to generate this example, as well as the output of napari --info?

import numpy as np
import napari

shape = (82, 65, 967, 516)
data = np.ones(shape)
for i in range(len(data)):
    start = 50+5*i
    strip = slice(start, start + 7)
    data[i,:,:,strip] = 3

with napari.gui_qt():
    viewer = napari.view_image(data, rgb=False, scale=[1, 1, 0.16, 0.16], contrast_limits=(0, 3))

The problem goes away if I choose Z = 16 instead of 65.

Problem enviornments that I tested

First One:

napari: 0.3.6
Platform: Darwin-18.7.0-x86_64-i386-64bit
Python: 3.7.3 (default, Mar 27 2019, 16:54:48)  [Clang 4.0.1 (tags/RELEASE_401/final)]
Qt: 5.14.2
PyQt5: 5.14.2
NumPy: 1.19.1
SciPy: 1.5.2
Dask: 2.21.0
VisPy: 0.6.4

GL version:  2.1 INTEL-12.10.12

  - napari-plugin-engine: 0.1.6
  - svg: 0.1.3

Second one:

napari: 0.3.6
Platform: Darwin-18.7.0-x86_64-i386-64bit
Python: 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 13:42:17)  [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
Qt: 5.14.2
PyQt5: 5.14.2
NumPy: 1.18.4
SciPy: 1.4.1
Dask: 2.17.2
VisPy: 0.6.4

GL version:  2.1 INTEL-12.10.12

  - napari-plugin-engine: 0.1.5
  - svg: 0.1.3

There is now extensive discussion of this in and further inquires should probably be directed there