silx icon indicating copy to clipboard operation
silx copied to clipboard

[profile] Diagonal profile on large stack of image can be slow

Open t20100 opened this issue 8 years ago • 10 comments

When drawing a profile on a large stack of images (I tested with 1k^3), the diagonal line drawing interaction becomes really slow. It would be better if the line remains drawn interactively even if the image profile is not updated at the same rate..

t20100 avatar Jun 07 '17 09:06 t20100

Is there a risk of having a displayed profile not corresponding to the drawn line? Current behavior is slow but safe in the sense of what you see is what you get.

vasole avatar Jun 07 '17 10:06 vasole

Yes if the slice is rendered asynchronously, we need some way to let the user know when the displayed image actually corresponds to the drawn profile line and when it is out-dated.

t20100 avatar Jun 07 '17 12:06 t20100

This seems to came from the commit eb485717e7e5345c1941c2770494d3981065a487. Indeed if we use PyQt4 + matplotlib on the latest version the is no slow anymore but slow down appears if using PyQt5 instead.

Behavior is the same for PyQt4 + opengl and PyQt5 + opengl

payno avatar Jul 26 '18 15:07 payno

That's going to be fun... Is it the same version of matplotlib between PyQt4 and PyQt5?

t20100 avatar Jul 26 '18 15:07 t20100

Work with python3 + PySide2

payno avatar Jul 26 '18 15:07 payno

Yes same version of matplotlib. But the behavior is the same with openGL.

payno avatar Jul 26 '18 15:07 payno

works with PyQt5 5.10.0 + python3.5 fails with PyQt5 5.3.2 + python 2.7

payno avatar Jul 26 '18 15:07 payno

Hope this is fixed for latest PyQt5 version

payno avatar Jul 26 '18 15:07 payno

BTW, it looks there is 2 issues discussed here:

  • Profile on large stack (e.g., 1k**3) which to my knowledge has always been slow (and would need so asynchronous refresh).
  • Profile on small stack which is slow depending on PyQt version...

t20100 avatar Jul 27 '18 07:07 t20100

Should be tested, but with the new profile, the computation is done in a thread pool. So it maybe mitigate this problem.

vallsv avatar Apr 17 '20 16:04 vallsv