[R] using identify() together with plot () and pixmap()

Friedrich.Leisch@ci.tuwien.ac.at Friedrich.Leisch at ci.tuwien.ac.at
Tue Sep 30 11:38:34 CEST 2003


>>>>> On Tue, 30 Sep 2003 09:38:31 +0100,
>>>>> Barry Rowlingson (BR) wrote:

  > Christoph Lehmann wrote:
  >>> plot(pixmapGrey(fmri.vtc[,,slice,volume]))
  >>> identify(fmri.vtc[,,slice,volume])
  >> 
  >> warning: no point with 0.25 inches
  >> 
  >> 
  >> pressing the right mouse button I get:
  >> numeric(0)
  >> 
  >> what is the problem  here and how can I solve it?

  >   The problem is that there is no method for identifying points on a 
  > pixmap (and anyway, you are feeding identify() a matrix).

  >   You'll need to write an "identify.pixmapGrey" function. This would do 
  > something like use the 'locator()' function to get clicks on the screen, 
  > and then it would compute which grid cell the coordinates of those 
  > clicks were in. pixmap objects store enough information for you to work 
  > this out from the attributes - look at the 'bbox' attribute for example.

  >   It would make a nice addition to the pixmap library. Although one 
  > thing that just suprised me was that the different flavours of pixmap - 
  > pixmapGrey, pixmapIndexed, pixmapRGB - dont all inherit from a 'pixmap' 
  > class,

But they do, and class "pixmap" has the necessary geometry
information, i.e., size, bounding box and resolution of the image.

  > which might make it easier to write a single identify function 
  > for all the types.

yes, shouldn't bbe too hard (all contributions welcome).

.f




More information about the R-help mailing list