[pymvpa] Sphere() and extent checking

Matthias Ekman matthias.ekman at googlemail.com
Wed Oct 19 12:26:39 UTC 2011


Hi,

with previous versions of pymvpa (=< 0.4.7) I used

     dataset.mapper.getNeighbors(feature_id, radius)

to construct nodes for a functional connectivity analysis. In mvpa2 this 
functionality is embedded in

     mvpa2.misc.neighborhood.Sphere()

However, as written in the docstring " No validation of producing 
coordinates within any extent is done" which would be necessary for my 
purpose.

There is some commented code in mvpa2/misc/neighborhood.py which I 
thought I could simply uncomment for my purpose (see below)... but it 
doesn't work. Where does 'self.extent' come from, or more specifically: 
may I ask you guys to give me some advise on how to do the extent 
checking here?

         # XXX may be optionally provide extent checking?
         ## # now filter out illegal coordinates if they really are 
outside the
         ## # bounds
         ## if (coordinate - self.radius < 0).any() \
         ## or (coordinate + self.radius >= self.extent).any():
         ##     coord_array = array([c for c in coord_array \
         ##                            if (c >= 0).all()
         ##                            and (c < self.extent).all()])
         ## coord_array = coord_array.transpose()


Thanks in advance,
  Matthias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/attachments/20111019/b6fd83fd/attachment.html>


More information about the Pkg-ExpPsy-PyMVPA mailing list