[Numpy-discussion] Neighborhood iterator: way to easily check which elements have already been visited in parent iterator?

2012-06-13 Thread Thouis (Ray) Jones
Hello, I'm rewriting scipy.ndimage.label() using numpy's iterator API, and would like to add the ability for it to operate in-place. However, to do so, I need to limit the neighbors consulted to those that have already been processed in the parent iterator over the input and output arrays. Is

Re: [Numpy-discussion] Neighborhood iterator: way to easily check which elements have already been visited in parent iterator?

2012-06-13 Thread Tim Cera
Tried to figure out in-place calculation for the neighbor routine that I recently submitted to numpy, but got nowhere. See https://github.com/numpy/numpy/pull/303 for what I came up with. It currently makes a new array to hold the calculations. If someone does come up with something - I would

Re: [Numpy-discussion] Neighborhood iterator: way to easily check which elements have already been visited in parent iterator?

2012-06-13 Thread Ralf Gommers
On Wed, Jun 13, 2012 at 6:57 PM, Thouis (Ray) Jones tho...@gmail.comwrote: Hello, I'm rewriting scipy.ndimage.label() using numpy's iterator API, I think there were some changes to the iterator API recently, so please keep in mind that scipy has to still be compatible with numpy 1.5.1 (at

Re: [Numpy-discussion] Neighborhood iterator: way to easily check which elements have already been visited in parent iterator?

2012-06-13 Thread Thouis (Ray) Jones
On Wed, Jun 13, 2012 at 7:58 PM, Ralf Gommers ralf.gomm...@googlemail.com wrote: I think there were some changes to the iterator API recently, so please keep in mind that scipy has to still be compatible with numpy 1.5.1 (at least for now). Noted. I'll rewrite using the 1.5 API, and save this

Re: [Numpy-discussion] Neighborhood iterator: way to easily check which elements have already been visited in parent iterator?

2012-06-13 Thread David Cournapeau
Not the neighborhood one, though. It would be good if this iterator had a cython wrapper, and ndimage used that, though. Le 13 juin 2012 18:59, Ralf Gommers ralf.gomm...@googlemail.com a écrit : On Wed, Jun 13, 2012 at 6:57 PM, Thouis (Ray) Jones tho...@gmail.comwrote: Hello, I'm rewriting

Re: [Numpy-discussion] neighborhood iterator speed

2011-10-25 Thread Nadav Horesh
: numpy-discussion-boun...@scipy.org [mailto:numpy-discussion-boun...@scipy.org] On Behalf Of Nadav Horesh Sent: Monday, October 24, 2011 9:02 PM To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] neighborhood iterator speed I found the 2d iterator definition active in numpy 1.6.1. I'll

Re: [Numpy-discussion] neighborhood iterator speed

2011-10-24 Thread David Cournapeau
On Mon, Oct 24, 2011 at 6:57 AM, Nadav Horesh nad...@visionsense.com wrote: I am trying to replace an old code (biliteral filter) that rely on ndimage.generic_filter with the neighborhood iterator. In the old code, the generic_filter generates a contiguous copy of the neighborhood, thus the

Re: [Numpy-discussion] neighborhood iterator speed

2011-10-24 Thread Nadav Horesh
Nadav -Original Message- From: numpy-discussion-boun...@scipy.org [mailto:numpy-discussion-boun...@scipy.org] On Behalf Of David Cournapeau Sent: Monday, October 24, 2011 9:38 AM To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] neighborhood iterator speed On Mon, Oct 24

Re: [Numpy-discussion] neighborhood iterator speed

2011-10-24 Thread David Cournapeau
On Mon, Oct 24, 2011 at 10:48 AM, Nadav Horesh nad...@visionsense.com wrote: * Iterator mode: Mirror. Does the mode make a huge difference? It could, at least in principle. The underlying translate function is called often enough that a slight different can be significant. * I can not find any

Re: [Numpy-discussion] neighborhood iterator speed

2011-10-24 Thread Nadav Horesh
...@scipy.org] On Behalf Of David Cournapeau Sent: Monday, October 24, 2011 1:57 PM To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] neighborhood iterator speed On Mon, Oct 24, 2011 at 10:48 AM, Nadav Horesh nad...@visionsense.com wrote: * Iterator mode: Mirror. Does the mode make a huge

Re: [Numpy-discussion] neighborhood iterator speed

2011-10-24 Thread David Cournapeau
On Mon, Oct 24, 2011 at 1:23 PM, Nadav Horesh nad...@visionsense.com wrote: * I'll try to implement the 2D iterator as far as far as my programming expertise goes. It might take few days. I am pretty sure the code is in the history, if you are patient enough to look for it in git history. I

Re: [Numpy-discussion] neighborhood iterator speed

2011-10-24 Thread Nadav Horesh
[mailto:numpy-discussion-boun...@scipy.org] On Behalf Of David Cournapeau Sent: Monday, October 24, 2011 4:04 PM To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] neighborhood iterator speed On Mon, Oct 24, 2011 at 1:23 PM, Nadav Horesh nad...@visionsense.com wrote: * I'll try

Re: [Numpy-discussion] neighborhood iterator speed

2011-10-24 Thread Nadav Horesh
of Numerical Python Subject: Re: [Numpy-discussion] neighborhood iterator speed On Mon, Oct 24, 2011 at 1:23 PM, Nadav Horesh nad...@visionsense.com wrote: * I'll try to implement the 2D iterator as far as far as my programming expertise goes. It might take few days. I am pretty sure the code

[Numpy-discussion] neighborhood iterator speed

2011-10-23 Thread Nadav Horesh
I am trying to replace an old code (biliteral filter) that rely on ndimage.generic_filter with the neighborhood iterator. In the old code, the generic_filter generates a contiguous copy of the neighborhood, thus the (cython) code could use C loop to iterate over the neighbourhood copy. In the

Re: [Numpy-discussion] neighborhood iterator

2009-11-23 Thread Nadav Horesh
-Nov-09 03:21 To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] neighborhood iterator On 22-Nov-09, at 12:50 PM, Nadav Horesh wrote: I wonder if the neighbourhood iterator can be used as a more efficient replacement for ndimage.generic_filter. Is there a way to use

Re: [Numpy-discussion] neighborhood iterator

2009-11-23 Thread Zachary Pincus
: numpy-discussion-boun...@scipy.org on behalf of David Warde- Farley Sent: Mon 23-Nov-09 03:21 To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] neighborhood iterator On 22-Nov-09, at 12:50 PM, Nadav Horesh wrote: I wonder if the neighbourhood iterator can be used as a more

[Numpy-discussion] neighborhood iterator

2009-11-22 Thread Nadav Horesh
I wonder if the neighbourhood iterator can be used as a more efficient replacement for ndimage.generic_filter. Is there a way to use it from cython? Nadav. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] neighborhood iterator

2009-11-22 Thread David Warde-Farley
On 22-Nov-09, at 12:50 PM, Nadav Horesh wrote: I wonder if the neighbourhood iterator can be used as a more efficient replacement for ndimage.generic_filter. Is there a way to use it from cython? Yes, using the NumPy C API, called like any other C function is from Cython. Something