Getting the pixel values on an image

Hi,

How can I get the pixel values when I click the mouse on an image ?

say it is an elevation model, so I need to have elevation value on the point I clicked

Do you have any idea?

kind regards

Hi Ahmet,

Do you want to get pixel values on Python side or on JS side?

Regards,

Eugene

···

On Wednesday, January 24, 2018 at 2:49:25 PM UTC+7, Ahmet Temiz wrote:

Hi,

How can I get the pixel values when I click the mouse on an image ?

say it is an elevation model, so I need to have elevation value on the point I clicked

Do you have any idea?

kind regards

Hi Eugene,
thank you

Firstly, JS side.

But I am also enthusiastic to know how for python side.

regards

···

On Wednesday, January 24, 2018 at 10:49:25 AM UTC+3, Ahmet Temiz wrote:

Hi,

How can I get the pixel values when I click the mouse on an image ?

say it is an elevation model, so I need to have elevation value on the point I clicked

Do you have any idea?

kind regards

Hmm, it appears to not be that simple - Tap event gives coordinates relative to the whole canvas, that includes the plot itself and any axes. Also, you can move the image, which complicates stuff.
The issue is that the image glyph doesn’t have any hit tests implemented, so if you use TapTool, it won’t detect any tapping.

I suggest you create a GitHub issue with a feature request to support hit tests for image glyphs.

  • Eugene
···

On Wednesday, January 24, 2018 at 6:45:56 PM UTC+7, Ahmet Temiz wrote:

Hi Eugene,
thank you

Firstly, JS side.

But I am also enthusiastic to know how for python side.

regards

On Wednesday, January 24, 2018 at 10:49:25 AM UTC+3, Ahmet Temiz wrote:

Hi,

How can I get the pixel values when I click the mouse on an image ?

say it is an elevation model, so I need to have elevation value on the point I clicked

Do you have any idea?

kind regards

I suggest to look into Holoviews with bokeh.

···

On Jan 24, 2018, at 4:20 AM, Eugene Pakhomov [email protected] wrote:

Hmm, it appears to not be that simple - Tap event gives coordinates relative to the whole canvas, that includes the plot itself and any axes. Also, you can move the image, which complicates stuff.
The issue is that the image glyph doesn’t have any hit tests implemented, so if you use TapTool, it won’t detect any tapping.

I suggest you create a GitHub issue with a feature request to support hit tests for image glyphs.

  • Eugene

On Wednesday, January 24, 2018 at 6:45:56 PM UTC+7, Ahmet Temiz wrote:

Hi Eugene,
thank you

Firstly, JS side.

But I am also enthusiastic to know how for python side.

regards

On Wednesday, January 24, 2018 at 10:49:25 AM UTC+3, Ahmet Temiz wrote:

Hi,

How can I get the pixel values when I click the mouse on an image ?

say it is an elevation model, so I need to have elevation value on the point I clicked

Do you have any idea?

kind regards

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/e7e498e6-b9d6-4661-89d5-236e6b47a38e%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

There is an open issue already:
  
  Feature Request: Add hover inspection Image glyphs · Issue #3886 · bokeh/bokeh · GitHub

In fact Phillip intends to work on it very soon, but it has to happen after the ongoing, somewhat invasive Selection Model refactor is done.

Euguene, can you clarify our comment about the Tap event? It should be providing both sx/sy (screen) coordinates as well as x/y (data) coordinates:

  https://bokeh.pydata.org/en/latest/docs/reference/events.html#bokeh.events.Tap

If not, that is a bug.

Thanks,

Bryan

···

On Jan 24, 2018, at 08:32, Martin Garcia <[email protected]> wrote:

I suggest to look into Holoviews with bokeh.

On Jan 24, 2018, at 4:20 AM, Eugene Pakhomov <[email protected]> wrote:

Hmm, it appears to not be that simple - Tap event gives coordinates relative to the whole canvas, that includes the plot itself and any axes. Also, you can move the image, which complicates stuff.
The issue is that the image glyph doesn't have any hit tests implemented, so if you use TapTool, it won't detect any tapping.
I suggest you create a GitHub issue with a feature request to support hit tests for image glyphs.

- Eugene

On Wednesday, January 24, 2018 at 6:45:56 PM UTC+7, Ahmet Temiz wrote:

Hi Eugene,
thank you

Firstly, JS side.

But I am also enthusiastic to know how for python side.

regards

On Wednesday, January 24, 2018 at 10:49:25 AM UTC+3, Ahmet Temiz wrote:
Hi,

How can I get the pixel values when I click the mouse on an image ?
say it is an elevation model, so I need to have elevation value on the point I clicked

Do you have any idea?

kind regards

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/e7e498e6-b9d6-4661-89d5-236e6b47a38e%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/0D5FE431-627A-43CC-AB8C-C16082709CB2%40gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hey Bryan,

It does provide them, but since the data coordinates are float values, there will be some potentially imprecise calculations, especially if your data range is way close to 0.

Regards,

Eugene

···

On Wednesday, January 24, 2018 at 9:54:30 PM UTC+7, Bryan Van de ven wrote:

There is an open issue already:

    [https://github.com/bokeh/bokeh/issues/3886](https://github.com/bokeh/bokeh/issues/3886)

In fact Phillip intends to work on it very soon, but it has to happen after the ongoing, somewhat invasive Selection Model refactor is done.

Euguene, can you clarify our comment about the Tap event? It should be providing both sx/sy (screen) coordinates as well as x/y (data) coordinates:

    [https://bokeh.pydata.org/en/latest/docs/reference/events.html#bokeh.events.Tap](https://bokeh.pydata.org/en/latest/docs/reference/events.html#bokeh.events.Tap)

If not, that is a bug.

Thanks,

Bryan

On Jan 24, 2018, at 08:32, Martin Garcia [email protected] wrote:

I suggest to look into Holoviews with bokeh.

On Jan 24, 2018, at 4:20 AM, Eugene Pakhomov [email protected] wrote:

Hmm, it appears to not be that simple - Tap event gives coordinates relative to the whole canvas, that includes the plot itself and any axes. Also, you can move the image, which complicates stuff.

The issue is that the image glyph doesn’t have any hit tests implemented, so if you use TapTool, it won’t detect any tapping.

I suggest you create a GitHub issue with a feature request to support hit tests for image glyphs.

  • Eugene

On Wednesday, January 24, 2018 at 6:45:56 PM UTC+7, Ahmet Temiz wrote:

Hi Eugene,

thank you

Firstly, JS side.

But I am also enthusiastic to know how for python side.

regards

On Wednesday, January 24, 2018 at 10:49:25 AM UTC+3, Ahmet Temiz wrote:

Hi,

How can I get the pixel values when I click the mouse on an image ?

say it is an elevation model, so I need to have elevation value on the point I clicked

Do you have any idea?

kind regards


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/e7e498e6-b9d6-4661-89d5-236e6b47a38e%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/0D5FE431-627A-43CC-AB8C-C16082709CB2%40gmail.com.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.