Does anyone have a Chaco FunctionImageData example ?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Does anyone have a Chaco FunctionImageData example ?

Gary Ruben-2
Hi,

I'm trying to display a 2D array with Chaco. Because computing the full
array is very slow and I'm able to compute small rectangular regions of
it corresponding to the data region I want to show, I want to try to do
a 2D equivalent of what the functionplotter.py example does in 1D.

Does anyone have a self-contained example akin to the functionplotter.py
example that uses the Chaco FunctionImageData class? e.g. something like
a mandelbrot set explorer or even something that pans and zooms around
an image?
I've read the old thread here
http://www.digipedia.pl/usenet/thread/15882/127/
but I'm struggling to make a minimal working example.

thanks,
Gary R.
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Does anyone have a Chaco FunctionImageData example ?

Gary Ruben-2
I've made a small amount of progress on this.
Here is a modification of the functionplotter.py example, extended to 2D
https://gist.github.com/3903810

It's almost working, although I don't understand why the Chaco plot
window is not updating with data corresponding to the region limits.
Also, for my real example I'll probably have to kick off some sort of
thread to do the actual computation of the windowed array region.

Gary R.

On 17/10/2012 1:15 PM, Gary Ruben wrote:

> Hi,
>
> I'm trying to display a 2D array with Chaco. Because computing the full
> array is very slow and I'm able to compute small rectangular regions of
> it corresponding to the data region I want to show, I want to try to do
> a 2D equivalent of what the functionplotter.py example does in 1D.
>
> Does anyone have a self-contained example akin to the functionplotter.py
> example that uses the Chaco FunctionImageData class? e.g. something like
> a mandelbrot set explorer or even something that pans and zooms around
> an image?
> I've read the old thread here
> http://www.digipedia.pl/usenet/thread/15882/127/
> but I'm struggling to make a minimal working example.
>
> thanks,
> Gary R.


--
Gary Ruben
Software Engineer
VeRSI - Victorian eResearch Strategic Initiative
e. [hidden email]
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Does anyone have a Chaco FunctionImageData example ?

Robert Kern
On Wed, Oct 17, 2012 at 6:22 AM, Gary Ruben <[hidden email]> wrote:
> I've made a small amount of progress on this.
> Here is a modification of the functionplotter.py example, extended to 2D
> https://gist.github.com/3903810
>
> It's almost working, although I don't understand why the Chaco plot
> window is not updating with data corresponding to the region limits.
> Also, for my real example I'll probably have to kick off some sort of
> thread to do the actual computation of the windowed array region.

The problem is that the image plot's "index" datasource never gets
told that it should be placed anywhere except the (-1,-1,1,1) box. You
need to update that when the range changes:

https://gist.github.com/3904795

--
Robert Kern
Enthought
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Does anyone have a Chaco FunctionImageData example ?

Gary Ruben-2
Thank you for your help Robert. That should work in my application. If
not I'll see how I go pushing the computation into a separate thread. Of
course, feel free to add this to the Chaco examples if you think it's
useful.

Gary R.

On 17/10/2012 9:07 PM, Robert Kern wrote:

> On Wed, Oct 17, 2012 at 6:22 AM, Gary Ruben<[hidden email]>  wrote:
>> I've made a small amount of progress on this.
>> Here is a modification of the functionplotter.py example, extended to 2D
>> https://gist.github.com/3903810
>>
>> It's almost working, although I don't understand why the Chaco plot
>> window is not updating with data corresponding to the region limits.
>> Also, for my real example I'll probably have to kick off some sort of
>> thread to do the actual computation of the windowed array region.
>
> The problem is that the image plot's "index" datasource never gets
> told that it should be placed anywhere except the (-1,-1,1,1) box. You
> need to update that when the range changes:
>
> https://gist.github.com/3904795
>

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev