Commit Graph

44 Commits

Author SHA1 Message Date
2xB
4a592ef10e
Prevent element-wise string comparison
Issue #835 shows that comparing `bins`, which may be a numpy array, with a string `'auto'` leads to element-wise comparison, because the `==` operator for numpy arrays is used. With this commit, potential array and string are switched, so the `==` operator for strings is used, which does no element-wise comparison.
2019-06-17 19:10:32 +02:00
Kenneth Lyons
deab37d533 Try to import from collections.abc for Python 3.3+ (#887)
* Try to import from collections.abc for Python 3.3+
2019-05-25 16:25:49 -07:00
Jim Crowell
d261c2f0f2 fixed bug in graphicsItems/ImageItem.py: degenerate images (max==min) would raise exception in getHistogram() 2018-10-10 10:29:16 -04:00
Luke Campagnola
efaf61f711
Merge pull request #541 from justengel/image_render_error
ImageItem render error if graph is too small.
2018-09-28 15:38:02 -07:00
Pol Welter
d35991ec37 Fix issue #699
Nan in image data not handled properly
2018-06-01 15:05:14 +02:00
Luke Campagnola
748ca554e4
Merge pull request #675 from campagnola/fix-empty-image
Gracefully handle case where image data has size==0
2018-04-25 16:57:43 -07:00
Luke Campagnola
1206981107
Merge pull request #528 from HashSplat/master
Fixed downsample inf image issue
2018-04-25 16:32:02 -07:00
Luke Campagnola
0c1cda4973 Gracefully handle case where image data has size==0 2018-04-25 16:11:25 -07:00
Luke Campagnola
a06ca1df29
Merge pull request #600 from miranis/patch-2
Update ImageItem.py
2018-01-29 20:36:09 -08:00
miranis
5d09746738 Update ImageItem.py
Functions nanmin and nanmax are defined in the numpy module and cannot be accessed from the global namespace!
2017-10-23 01:45:52 +02:00
Luke Campagnola
c3e52f15b0 Fix ImageItem rgb histogram calculation 2017-10-03 08:16:36 -07:00
Luke Campagnola
07d1a62bfc ImageItem: add support for rgb handling by histogramlut 2017-09-26 08:31:28 -07:00
HashSplat
1ea4f5ab6f ImageItem render error if graph is too small.
Fixed issue where render would error because 'mapToDevice' would return None if the view size was too small.
2017-08-31 08:55:58 -04:00
HashSplat
e7ba0ca272 Found that downsample would set the image size to 0 causing errors. 2017-08-08 15:35:54 -04:00
HashSplat
70831245a8 Fixed issue where ImageItem data size would be 0 due to colormap. 2017-08-08 14:58:33 -04:00
Luke Campagnola
e87eaa652d Docstring correction 2017-07-14 15:10:04 -07:00
Luke Campagnola
152c5d393f Fixed bool / monochrome image display, added more unit tests 2016-09-07 17:56:00 -07:00
Luke Campagnola
748a8433b9 minor edits 2016-09-06 17:46:52 -07:00
Luke Campagnola
db07a16913 Test update and more bugfixes 2016-08-31 15:15:44 -07:00
Luke Campagnola
df691596a7 ROI tests pass with row-major axis order 2016-08-25 18:18:15 -07:00
Luke Campagnola
a76fc37112 imageAxisOrder config option now accepts "row-major" and "col-major" instead of "normal" and "legacy"
ImageItems can individually control their axis order
image tests pass with axis order check
2016-08-23 09:10:26 -07:00
Luke Campagnola
bee5878915 Added imageAxisOrder config option
Added global config documentation
ROIs don't exactly work yet..
2016-08-23 09:06:43 -07:00
Luke Campagnola
8b0c61ef01 Add ImageItem tests, fix image downsampling bug 2016-07-18 17:21:02 -07:00
Luke Campagnola
2a80205dd4 ImageItem bugfix 2016-01-30 09:52:37 -08:00
Luke Campagnola
70482432b8 Improve ImageItem performance by scaling LUT instead of image when possible.
Moved eq function from flowcharts to main function library to support this.
Bonus: fixed a flowchart bug (backspace deletes wrong connector) while I was in there.
2016-01-30 00:10:25 -08:00
fedebarabas
ab1051f494 invalid slice fix 2015-09-04 19:21:38 -03:00
Eric Dill
3bdb29e521 MNT: Remove commented code 2015-07-12 10:23:10 -05:00
Eric Dill
f929f40c51 BUG: Divide by zero error in ImageItem autoDownsample 2015-07-11 17:43:57 -05:00
Luke Campagnola
42eae475b9 Disable image downsampling when n=1 2014-08-07 09:12:31 -04:00
Luke Campagnola
753ac9b4c4 Squashed commit of the following:
commit ca3fbe2ff9
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Thu Aug 7 08:41:30 2014 -0400

    Merged numerous updates from acq4:
    * Added HDF5 exporter
    * CSV exporter gets (x,y,y,y) export mode
    * Updates to SVG, Matplotlib exporter
    * Console can filter exceptions by string
    * Added tick context menu to GradientEditorItem
    * Added export feature to imageview
    * Parameter trees:
        - Option to save only user-editable values
        - Option to set visible title of parameters separately from name
        - Added experimental ParameterSystem for handling large systems of
            interdependent parameters
        - Auto-select editable portion of spinbox when editing
    * Added Vector.__abs__
    * Added replacement garbage collector for avoiding crashes on multithreaded Qt
    * Fixed "illegal instruction" caused by closing file handle 7 on OSX
    * configfile now reloads QtCore objects, Point, ColorMap, numpy arrays
    * Avoid triggering recursion issues in exception handler
    * Various bugfies and performance enhancements
2014-08-07 09:03:26 -04:00
Luke Campagnola
e46439b903 minor docstring updates 2014-04-11 10:54:21 -04:00
Luke Campagnola
7d32ef85be Added automatic image downsampling (disabled by default)
- Reduces aliasing when zoomed out
  - Improves performance and memory usage for large images
Merge branch 'image_downsampling' into develop

Conflicts:
	pyqtgraph/graphicsItems/ImageItem.py
2014-02-17 20:48:22 -05:00
Luke Campagnola
bccbc29940 Bugfixes:
- isosurface works for arrays with shapes > 255
 - Fixed ImageItem exception building histogram when image has only one value
 - Fixed MeshData exception caused when vertexes have no matching faces
 - Fixed GLViewWidget exception handler
2014-02-03 22:24:45 -05:00
Luke Campagnola
b3e07a0e0a ImageItem fix against a51c30d 2014-01-18 19:59:36 -05:00
Luke Campagnola
e8dd3e6e57 ImageItem.getHistogram is more clever about constructing histograms:
- integer dtype images now have integer-aligned bins, with bin number
    determined by a target value
  - step size is automatically chosen based on a target image size
  - bins and step arguments have default values 'auto'
2014-01-14 22:22:50 -05:00
Antony Lee
20b9d079ce Nicer range for value histogram of integer images.
When an ImageItem's data has an integer dtype, this patch ensures that
each bin of the LUT histogram contains the same number of integer
values, in order to avoid "spikes" in the histogram that are merely due
to some bins covering more integer values than others.

This commit needs testing (it was rebased from an old commit).
2014-01-14 01:33:52 -08:00
Luke Campagnola
f630734453 Switching to relative imports to allow pyqtgraph to be imported under other names.
finished top-level files and graphicsItems
2013-12-22 02:08:39 -05:00
Antony Lee
f136b33033 Profilers controllable via PYQTGRAPHPROFILE.
A new function profiling system is implemented.  Most importantly, this
allows one to profile various internal functions directly by setting the
`PYQTGRAPHPROFILE` environment variable to a comma separated list of
function and method names, e.g.

    PYQTGRAPHPROFILE=functions.makeARGB,ImageItem.render \
        python -mexamples

Specifically, items in `PYQTGRAPHPROFILE` must be of the form
`classname.methodname` or `dotted_module_name.functionname`, with the
initial "pyqtgraph." stripped from the dotted module name.

Moreover, the overhead of inactive profilers has been kept minimal: an
introspective check of the caller's name (only if `PYQTGRAPHPROFILE` is
set) and a trivial function (not method) call per profiler call.

The new profilers rely on `sys._getframe` to find the caller's name,
although the previous system (passing the caller's name explicitely)
could certainly have been kept instead.

Finally the API of profilers has been changed: register a
profiling point simply by calling the profiler, and profilers are
automatically flushed on garbage collection.  See the docstring of
`pyqtgraph.debug.Profiler` for more details.
2013-11-27 09:57:46 -08:00
Luke Campagnola
71ee4deb84 - fixed ImageItem handling of rgb images
- fixed makeARGB re-ordering of color channels
2013-11-24 21:10:06 -05:00
Luke Campagnola
bd2330af9f ImageItem performance boost by avoiding makeQImage(transpose=True) 2013-11-24 20:45:10 -05:00
Luke Campagnola
0a5cb62a6f ImageItem now has auto downsampling; seems to be working properly.
Still need auto clipping as well.
2013-11-20 13:51:39 -05:00
Luke Campagnola
cbd0efe79a ImageItem informs ViewBox when its size changes
Minor edits
2013-06-19 19:32:55 -04:00
Luke Campagnola
2f510de2ca Added PolyLineROI.getArrayRegion 2013-03-13 17:17:39 -04:00
Luke Campagnola
af59296231 Reorganized directory structure to be more standard
Started new SVG exporter
Merged updates from ACQ4
2012-12-25 00:43:31 -05:00