Commit Graph

2648 Commits

Author SHA1 Message Date
KIU Shueng Chuan
45cf3100de no need to form a 1d 32-bit lut for array indexing
you can index (y, x) into a lookup table of shape (nentry, 3) or
(nentry, 4) and get an output of shape (y, x, 3) or (y, x, 4)
2021-04-13 03:42:11 +08:00
KIU Shueng Chuan
900d6743d8 set ImageItem as row-major 2021-04-13 03:42:11 +08:00
KIU Shueng Chuan
f24bf09557 got width and height swapped in array dimensions 2021-04-13 03:42:11 +08:00
KIU Shueng Chuan
c69c717af4 uint16 mono with rgb lut -> RGBX8888 2021-04-13 03:42:11 +08:00
KIU Shueng Chuan
81cc4eb797 check ImageItem uint8 and uint16 QImage formats 2021-04-13 03:42:11 +08:00
KIU Shueng Chuan
a6bbb1c48c fix: support colormaps of shape (h, 1) 2021-04-13 03:42:11 +08:00
KIU Shueng Chuan
941a436df7 add support for Format_RGBA64 2021-04-13 03:42:11 +08:00
KIU Shueng Chuan
eba908632a handle uint16 rgb(a) with no levels same as levels=[0, 65535] 2021-04-13 03:42:11 +08:00
KIU Shueng Chuan
f59097a484 ndarray indexing is faster than np.take 2021-04-13 03:42:11 +08:00
KIU Shueng Chuan
29ad432f5a apply the efflut early for uint16 mono/rgb, uint8 rgb 2021-04-13 03:42:11 +08:00
KIU Shueng Chuan
38fbb3fa46 add Grayscale16 2021-04-13 03:42:11 +08:00
KIU Shueng Chuan
59b835edf7 make use of Grayscale8, RGB888 and Indexed8 QImage formats
Grayscale8 and RGB888 images are those that are ready for display
without further processing.
2021-04-13 03:42:11 +08:00
KIU Shueng Chuan
f8c30eb712 combine levels back with lut 2021-04-13 03:42:11 +08:00
KIU Shueng Chuan
4650b66414 refactor out _ndarray_to_qimage() 2021-04-13 03:42:11 +08:00
Ogi Moore
6f74d56266
Merge pull request #1710 from pijyoi/reorder_tests
run pyqtgraph tests before examples
2021-04-11 08:10:53 -07:00
Ogi Moore
d2e1f99b5e
Merge pull request #1708 from j9ac9k/remove-infiniteline-from-others-example
Remove infiniteline from others in examples
2021-04-11 08:08:25 -07:00
KIU Shueng Chuan
8cb53d321b run pyqtgraph tests before examples 2021-04-11 21:51:44 +08:00
Ogi Moore
fe6ad52262 Remove infiniteline from others in examples 2021-04-10 23:10:12 -07:00
Ogi Moore
5a08650853
Improve target item - incorporate bits from PR 313 (#1318)
Overhaul TargetItem based on @lesauxvi 's PR #313
2021-04-10 22:42:44 -07:00
Ogi Moore
bb90ef1ec9
Merge pull request #1707 from pijyoi/pyqt61_compat
add PyQt6 6.1 forwards compatibility
2021-04-10 20:27:04 -07:00
Ogi Moore
a3443571f2
Merge pull request #1706 from ntjess/update-mkPen
promote use of '#' in mkPen
2021-04-10 20:21:53 -07:00
KIU Shueng Chuan
2aed5c36d5 no need to reconstruct PyQt6 enums
PyQt6 can serialize / deserialize enums and flags w/o us manually
casting them to int.

In PyQt6 6.0, it was okay to pass the already deserialized flag
back to the class constructor.
In PyQt6 6.1, the flags MouseButtons and KeyboardModifiers have
been renamed to MouseButton and KeyboardModifier respectively.

skipping the reconstruction allows it to work on both PyQt6 6.0 and 6.1.
note that this was already done in deserialize_mouse_event()
2021-04-11 09:53:49 +08:00
KIU Shueng Chuan
64702981d4 temporarily let PyQt6 6.1 run on PyQt6 6.0 ui files 2021-04-11 09:02:58 +08:00
KIU Shueng Chuan
4699bbad6b fix keyboard modifiers default value 2021-04-11 09:00:52 +08:00
Nathan Jessurun
e890d832e0 promote use of '#' in mkPen 2021-04-10 17:52:51 -04:00
Ogi Moore
10d924818c
Merge pull request #1701 from pijyoi/fix_overflow_warning
avoid numpy scalar overflow
2021-04-08 21:54:23 -07:00
KIU Shueng Chuan
3be8cafff4 avoid numpy scalar overflow
the "offset" argument passed into rescaleData() is typically an element
of an ndarray, i.e. it comes from the lower bound value of the "levels"
ndarray. as such, arithmetic operations on it can overflow.

this triggers a runtime warning in the test suite.

the workaround is to convert it to a Python (integer) scalar.
2021-04-09 10:14:23 +08:00
Martin Chase
0f94c17d86
Fix roi get array region (#1700)
* ROI.py, getArrayRegion: Fix return mapped coordinates

The *getArrayRegion* method is defined as returning a tuple of the points
in the selected region and the mapped coordinates if the
*returnMappedCoords* keyword argument is set to True in the parent class
*ROI*.

In the *EllipseROI* class, *getArrayRegion* was overriden, however it
ignores the *returnMappedCoords* keyword argument, leading to unintended
bugs because of the change in interface between the parent class and
the subclass.

This patch fixes the above bug.
If *returnMappedCoords* is set to False, then only *arr* containing the
array region is returned. If *returnMappedCoords* is set to True, a
tuple of the array region and the mapped coordinates is returned.

NB: At the time of this commit, the same bug is present in several classes
extending *ROI*. This commit only fixes the issue for the *EllipseROI* class.

* ROI.py, PolyLineROI.getArrayRegion: Fix return mapped coordinats

The *getArrayRegion* method is defined as returning a tuple of the
points in the selected region and the mapped coordinates if the
*returnMappedCoords* keyword argument is set to True in the parent class
*ROI*.

In the *PolyLineROI* class, *getArrayRegion* was overriden, however it
ignores the *returnMappedCoords* keyword argument, leading to unintended
bugs because of the change in interface between the parent class and the
subclass.

This patch fixes the above bug.  If *returnMappedCoords* is set to
False, then only *arr* containing the array region is returned. If
*returnMappedCoords* is set to True, a tuple of the array region and the
mapped coordinates is returned.

* remove merge conflict cruft

* lint

Co-authored-by: Malik Olivier Boussejra <malik@boussejra.com>
2021-04-08 13:43:30 -07:00
Kyle Sunden
711ad8afaa
Merge pull request #1696 from j9ac9k/0.12.1-changelog
Add changelog for 0.12.1
2021-04-06 20:52:46 -05:00
Kyle Sunden
03b7aa7860
Update version number for release 2021-04-06 20:41:32 -05:00
Ogi Moore
4bbbb189db Add changelog for 0.12.1 2021-04-06 13:08:49 -07:00
Ogi Moore
3ed206fa70
Merge pull request #1690 from ntjess/master
revert to old behavior: default created from value if not present
2021-04-06 13:07:10 -07:00
Ogi Moore
d4c5025289 Implement suggested changes from ixjlyons 2021-04-06 11:51:10 -07:00
pijyoi
aa57c7a685
implement rescaleData as a blocked iterator using np.nditer (#1648)
* implement rescaleData_blocked

clip limits should be int if data is int

* add test for rescaleData_blocked

* dispatch to different versions depending on numpy or cupy

* make rescaleData() the only entry-point
2021-04-05 23:02:52 -07:00
Nils Nemitz
758c038411
Add ColorBarItem for simplified image level adjustment (#1596)
* Initial implementation of ColorBarItem

* initial commit

* fixed missing indent

* docstring extension and corrections

* Converted example to match others / run as part of tests

* load local color maps instead of importing from colorcet

* clean up window creation code

* horizontal color bar and clean-up

* switched to mkQApp initialization

* cleaned up some comments
2021-04-05 20:50:52 -07:00
Nils Nemitz
929f3bda0d
make sure dynamic range limiter runs even when there isn't previous data (#1691) 2021-04-05 15:46:28 -07:00
Dennis Göries
b8cf3dded4
DateAxisItem: Account for daylight saving time (#1694)
* DateAxisItem: Account for daylight saving time

* Use  logic more visible in utcoffset

* Rename getOffsetFromUtc function
2021-04-05 15:45:08 -07:00
Nathan Jessurun
58d126dcf3 fixes tests 2021-04-03 20:31:04 -04:00
Nathan Jessurun
4b002c06ba revert to old behavior: default created from value if not present 2021-04-03 17:07:02 -04:00
Ogi Moore
07a99cb443
Merge pull request #1680 from pijyoi/rgba_endian
Fix CI tests for big-endian architectures
2021-04-01 20:37:06 -07:00
KIU Shueng Chuan
02a48afc60 test_makeARGB() : normalize to B,G,R,A 2021-04-01 08:38:10 +08:00
KIU Shueng Chuan
17e2f0f5f2 fix makeARGB() endian ordering 2021-04-01 08:38:08 +08:00
KIU Shueng Chuan
179b27ad8c image_testing.py: swap red and blue channels 2021-04-01 08:32:31 +08:00
Nils Nemitz
30071699d7
Include colormaps in installer (#1660)
* renamed mathods and moved color map example

* added colors/maps/ data to setup.py
2021-03-27 00:15:19 -07:00
Ogi Moore
4dc76ed90e
Merge pull request #1617 from pijyoi/fastpath_argb
Optimize makeARGB for ubyte images
2021-03-26 14:22:56 -07:00
Ogi Moore
1a597b80b7
Merge pull request #1662 from NilsNemitz/cast-to-int_in_ImageView_QSplitter.setSizes
added cast to int so that QSplitter.setSizes works on Python 3.10
2021-03-26 12:39:38 -07:00
Nils Nemitz
028f9d12a2 cast splitter settings to int in Canvas.py 2021-03-27 04:30:51 +09:00
Ogi Moore
21605faa44
Merge pull request #1666 from NilsNemitz/revert_styleUpdate_reduction
revert style change reduction in PlotDataItem
2021-03-26 12:12:41 -07:00
Ogi Moore
75abcb634e
Merge pull request #1665 from lidstrom83/bugfix-legend
Don't pass brush to fn.mkPen
2021-03-26 11:54:29 -07:00
Nils Nemitz
d8d5d49f04 revert style change reduction in PlotDataItem 2021-03-27 03:51:44 +09:00