[R] cursor position on image

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Jan 8 17:22:13 CET 2008


On Tue, 8 Jan 2008, Peter Hietz wrote:

> Hi,
>
> I am using the EBImage package for image display and analysis and want 
> to read the cursor (mouse) position on the image. The function 
> "locator()" would be ideal, but this appears to work only on plots, not 
> images.
>
>> a <- Image((0:(w^2))/w^2, c(w,w))
>> if ( interactive() ) display(a)
>> locator(n = 10, type = "p")
> Error in locator(n = 10, type = "p") : plot.new has not been called yet
>
> Is there a similar function that works with dispalyed images ?

It works with image().  For Image(), you will need to ask those who know 
about EBImage, and the best place to start is the Bioconductor list (it is 
a BioC package).  It is not using an R graphics device to display.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list