Question: get pixel coordinates interactively with EBimage
1
6.2 years ago by
Arnaud Duranel60 wrote:
Hello I am using R 2.13.0 & EBImage 3.8.0. I am looking for a way to obtain a pixel coordinates (as an R object) by clicking interactively on an image displayed in the GTK window using the EBImage display() function. I could use locator() after having converted the image to grayscale and displayed it using image(), but as far as I am aware I would not be able to zoom in and out and move the picture around interactively. Many thanks for your help. A. Duranel, UCL Department of Geography
ebimage • 875 views
modified 23 months ago by Andrzej Oleś720 • written 6.2 years ago by Arnaud Duranel60
Answer: get pixel coordinates interactively with EBimage
1
23 months ago by
Andrzej Oleś720
Heidelberg, Germany
Andrzej Oleś720 wrote:

It's possible to retrieve pixel coordinates interactively by using the function locator() in combination with the "raster" mode of display, as in the following example.

library("EBImage")

# load and display a sample image
img <- readImage(system.file("images", "sample.png", package="EBImage"))
display(img, method="raster")

# get the coordinates of parrots' eyes
x <- locator()

lapply(x, round)
## $x ## [1] 215 509 ## ##$y
## [1] 232 169
Answer: get pixel coordinates interactively with EBimage
0
6.2 years ago by
Andrzej Oleś720
Heidelberg, Germany
Andrzej Oleś720 wrote:
Dear Arnaud, many thanks for your inquiry! Unfortunately, for now EBImage is not capable of returning pixel coordinates interactively, as you would like to. However, we are aware of this shortcoming and we hope to come up with a solution to this in future releases. Nevertheless, I would strongly encourage you to upgrade to the current version of EBImage (4.0.0). It includes numerous improvements and bugfixes, does not rely on ImageMagick anymore, and introduces a new JavaScript image viewer in place of the old GTK-based one. Kind regards, Andrzej Oles EBImage Development Team On Mon, Jan 21, 2013 at 5:46 PM, Arnaud Duranel <arnaud.duranel.09 at="" ucl.ac.uk=""> wrote: > Hello > I am using R 2.13.0 & EBImage 3.8.0. > I am looking for a way to obtain a pixel coordinates (as an R object) by > clicking interactively on an image displayed in the GTK window using the > EBImage display() function. > I could use locator() after having converted the image to grayscale and > displayed it using image(), but as far as I am aware I would not be able to > zoom in and out and move the picture around interactively. > Many thanks for your help. > A. Duranel, UCL Department of Geography > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor