Bug report (affineSlice)

15 views
Skip to first unread message

Martin Craig

unread,
Apr 16, 2018, 4:18:41 AM4/16/18
to pyqtgraph
Hi, many thanks for pyqtgraph which I'm using extensively for visualisation, particularly the affineSlice function.

I've just come across a bug, or rather a missing feature, in affineSlice(). I am using the latest GitHub
development code for pyqtgraph/functions.py because I need a recent fix to make nearest-neighbour interpolation 
(order=0) work. 

However I've found that when using order=0 or order=1 I can't flag out-of-bounds data by setting cval=-999 (say) 
because interpolateArray doesn't use the same arguments as scipy.ndimage.map_coordinates. Instead it
uses default= to specify the value for out of bounds data and this is not passed by affineSlice.

I've patched my version by passing the keyword arguments through to interpolateArray and adding in one line
to pick up the cval argument:

default = kargs.get("cval", default)

There are probably better ways to fix it, but would be good if it could use the cval argument, and perhaps add a note
in the docs to explain that other out-of-bounds modes (mode='reflect', etc) are not supported for order=0, 1.

Apologies if this is already reported.

Thanks,
Martin.


Reply all
Reply to author
Forward
0 new messages