get pixel coordinates interactively with EBimage
2
1
Entering edit mode
@arnaud-duranel-5720
Last seen 9.6 years ago
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 EBImage • 2.3k views
ADD COMMENT
1
Entering edit mode
Andrzej Oleś ▴ 750
@andrzej-oles-5540
Last seen 3.4 years ago
Heidelberg, Germany

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
ADD COMMENT
0
Entering edit mode
Andrzej Oleś ▴ 750
@andrzej-oles-5540
Last seen 3.4 years ago
Heidelberg, Germany
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
ADD COMMENT

Login before adding your answer.

Traffic: 860 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6