Skip to content

Help to find a way to which voxel a point in space lies inside

5 messages · Marcelino de la Cruz, gianni lavaredo

#
Hi Gianni,

I don't know if I this is what you want but maybe would be based in 
something like this:

myPointsc <- apply(myPoints,2,cut, breaks=0:10, labels=paste("v", 
1:10, sep=""))
myPointsc <- apply(myPointsc,1,paste, collapse="")
 > myPoints[myPointsc=="v1v1v1",]
           [,1]      [,2]      [,3]
[1,] 0.8250876 0.9355083 0.1332186
[2,] 0.3455816 0.8866431 0.6895027
 > myPoints[myPointsc=="v1v1v2",]
      [,1] [,2] [,3]
 > myPoints[myPointsc=="v1v1v3",]
[1] 0.6749106 0.5506732 2.5559303
 >
etc


Cheers,

Marcelino
At 15:45 12/07/2012, gianni lavaredo wrote: