[pymvpa] Searchlight radius questions

Michael Hanke mih at debian.org
Tue Sep 11 06:49:09 UTC 2012


On Mon, Sep 10, 2012 at 11:21:02AM -0700, Jonas Kaplan wrote:
> Seems to me that radius of 1 gives 7 voxels, e.g.:
> 
> In [117]: radii = range(5)
> 
> In [118]: for radius in radii:
>    .....:     sp = Sphere(radius=radius)
>    .....:     size = len(sp((1,1,1)))
>    .....:     print "Radius %d size: %d" % (radius,size)
>    .....:     
> Radius 0 size: 1
> Radius 1 size: 7
> Radius 2 size: 33
> Radius 3 size: 123
> Radius 4 size: 257

Thanks Jonas!

In PyMVPA >= 0.6 voxel neighbors are elements that share an edge
(not just a corner), hence 7 elements for radius=1 (2 elements per axis
and the center). radius=0 will select just the center.

When selecting neighbors in a real (masked) dataset, the actual number
of elements can be less than the theoretical maximum, whenever not all
the potential neighbor coordinates are actually part of the
dataset/mask.

Hope that explains,

Michael

-- 
Michael Hanke
http://mih.voxindeserto.de



More information about the Pkg-ExpPsy-PyMVPA mailing list