Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageView initial time value set incorrectly to 0 #2918

Open
pijyoi opened this issue Jan 23, 2024 · 1 comment
Open

ImageView initial time value set incorrectly to 0 #2918

pijyoi opened this issue Jan 23, 2024 · 1 comment

Comments

@pijyoi
Copy link
Contributor

pijyoi commented Jan 23, 2024

Short description

If a time-axis is provided to ImageView, the initial position of the yellow line indicating the time position is wrongly set to 0. The actual value should have been the minimum time value.

Code to reproduce

import numpy as np
import pyqtgraph as pg

rng = np.random.default_rng(0)
data_cube = np.empty((9, 100, 100))
xvals = np.arange(data_cube.shape[0]) - data_cube.shape[0]//2

for idx, mu in enumerate(xvals):
    data_cube[idx, ...] = mu + rng.standard_normal(size=data_cube.shape[1:])

pg.mkQApp()
imv = pg.ImageView()
imv.setImage(data_cube, xvals=xvals)
imv.show()
pg.exec()

Expected behavior

In the snippet provided above, the mean value of the data slice is created such that it is equal to the time value.
Thus in the image provided below, the histogram shows that the data slice comes from time -4. However, the yellow time line is at time 0.

Real behavior

Capture

Tested environment(s)

  • PyQtGraph version: 0.13.3
  • Qt Python binding: PySide 6.6.1
  • Python version: 3.10.11
  • NumPy version: 1.26.2
  • Operating system: Windows 10
  • Installation method: pip

Additional context

@apoumier
Copy link

Hello, we are interested in trying to resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants