plotting markers on top of image plots

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

plotting markers on top of image plots

mike tallhamer
I'm doing som image processing to find the center of various overlapping
regions within a number of images. I would like to plot the image with a
marker plotted at the center of the region so that the user can
determine if they agree with the algorithm's choice of center. Ideally
this marker could be selected and dragged to a different location if the
user disagrees with the center location but for now it would just be
nice to be able to visualize the location of the center on top of the
image being processed. Can Chaco do this type of thing and are there
examples I can glean approaches from? I'm aware of the Chaco examples
with custom overlays but have not got them to work with image datasets
rather that the simple line and scatter plots.

Thanks,

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

Re: plotting markers on top of image plots

RJS
You could super-class wypyplot/wx.lib.plot, or just use wxpyplot as a
base for a new module and override or change the mouse function
behavior for click-drag.

Ray

At 02:56 PM 9/19/2011, Mike Tallhamer wrote:

>I'm doing som image processing to find the center of various overlapping
>regions within a number of images. I would like to plot the image with a
>marker plotted at the center of the region so that the user can
>determine if they agree with the algorithm's choice of center. Ideally
>this marker could be selected and dragged to a different location if the
>user disagrees with the center location but for now it would just be
>nice to be able to visualize the location of the center on top of the
>image being processed. Can Chaco do this type of thing and are there
>examples I can glean approaches from? I'm aware of the Chaco examples
>with custom overlays but have not got them to work with image datasets
>rather that the simple line and scatter plots.
>
>Thanks,
>
>Mike
>_______________________________________________
>Enthought-Dev mailing list
>[hidden email]
>https://mail.enthought.com/mailman/listinfo/enthought-dev

Ray Schumacher
Programmer/Consultant
PO Box 182, Pine Valley, CA 91962
(858)248-7232
http://rjs.org/ 
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: plotting markers on top of image plots

Peter Wang
In reply to this post by mike tallhamer
On Mon, Sep 19, 2011 at 4:56 PM, Mike Tallhamer
<[hidden email]> wrote:
> Ideally
> this marker could be selected and dragged to a different location if the
> user disagrees with the center location but for now it would just be
> nice to be able to visualize the location of the center on top of the
> image being processed. Can Chaco do this type of thing and are there
> examples I can glean approaches from?

Yes.  Look at the PointDraggingTool in examples/demo/edit_line.py.
Note that this tool has to be placed on a scatter plot.

> I'm aware of the Chaco examples
> with custom overlays but have not got them to work with image datasets
> rather that the simple line and scatter plots.

Which overlays in particular are you trying to place on top of the image plot?

At a high level, you should use the same Plot object to render both
the image plot as well as a secondary scatter plot that displays a
single point (the centroid as computed by your algorithm).  You will
need to attach the PointDraggingTool (as coded in the edit_line.py
example) to that scatter plot.  By using the same Plot object, you
ensure that the axes/scale of the image plot and the marker are always
lined up.


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