Hi macport users,
I am trying to run this script in python and the script is now working with
the test data (eigen problem solved) but when I input my own data to be
called by script I got the following errors.
[moriaht-5:~/Desktop/pyClusterROI] moriah% python pyClusterROI_test.py
tcorr connectivity subject2002.nii
Traceback (most recent call last):
File "pyClusterROI_test.py", line 89, in
make_local_connectivity_tcorr( infiles[i], maskname, outname, 0.5 )
File "/Users/moriah/Desktop/pyClusterROI/make_local_connectivity_tcorr.py",
line 114, in make_local_connectivity_tcorr
msk=csc_matrix((range(1,m+1),(iv,zeros(m))),shape=(prod(sz[1:]),1))
File "/opt/local/Library/Frameworks/Python.framework/
Versions/2.6/lib/python2.6/site-packages/scipy/sparse/compressed.py", line
44, in __init__
other = self.__class__( coo_matrix(arg1, shape=shape) )
File "/opt/local/Library/Frameworks/Python.framework/
Versions/2.6/lib/python2.6/site-packages/scipy/sparse/coo.py", line 188, in
__init__
self._check()
File "/opt/local/Library/Frameworks/Python.framework/
Versions/2.6/lib/python2.6/site-packages/scipy/sparse/coo.py", line 220, in
_check
raise ValueError('row index exceedes matrix dimensions')
ValueError: row index exceedes matrix dimensions
I was wondering if anyone might know what this error might mean or how to
fix it?
On Tue, Dec 4, 2012 at 3:49 PM, Sean Farley
wrote:
> On Mon, Dec 3, 2012 at 10:35 AM, Amy Anderson wrote:
> > Dear macports-users,
> >
> > I am a new macports, python, and scipy user and I am looking for some
> help
> > to troubleshoot an error I have been getting when trying to run a script
> in
> > python. The script I am trying to run is called pyCluster ROI and it
> needs
> > python, pynifti, scipy, and numpy to run. I have installed all these
> > programs successfully using macports on Mac OS 10.8.
> >
> >
> > I unarchived the scripts and ran the test script getting this error:
> >
> > $ python pyClusterROI_test.py
> >
> > Traceback (most recent call last):
> >
> > File "pyClusterROI_test.py", line 48, in
> >
> > from make_local_connectivity_scorr import *
> >
> > File
> >
> "/Users/matthewnye/Downloads/pyClusterROI/make_local_connectivity_scorr.py",
> > line 40, in
> >
> > from scipy.sparse.linalg.eigen.arpack import eigen_symmetric
> >
> > ImportError: cannot import name eigen_symmetric
> >
> >
> > I have been trying to hunt down what this error may be and it seems that
> > older versions of scipy might have used
> > ‘scipy.sparse.linalg.eigen.arpack.eigen symmetric()’ where as new
> versions
> > it has been renamed as "scipy.sparse.linalg.eigen.arpack.eigs()."
> >
> >
> > Does anyone know what might be causing this error or if it is a version
> > problem, is there any way to get an older version of scipy through
> macports?
> > Also I have considered installing all these modules through a manual
> install
> > but since i am a novice user I did not want to attempt that if there was
> a
> > potentially simpler solution.
>
> Woah, woah, woah now. Let's not go down the (more difficult) rabbit
> hole of installing an older version of a port. For this issue, there
> is a much easier solution (so please undo all the installations of an
> older scipy, etc.). After scipy 0.9.0, the function 'eigen_symmetric'
> was renamed to 'eigsh'. All you have to do is run,
>
> $ perl -i -pe 's,eigen_symmetric,eigsh,g' *.py
>
> in the pyClusterROI directory and you should get much further along.
> Alternatively, attached is a patch if you would prefer that, which you
> can run with,
>
> $ patch -p1 < /path/to/eigen_symmetric.patch
>
> For reference, I'm able to get to script to run on the test data and
> produce subject{1,2,…,etc.}.nii.gz. Also, as a bonus, I was able to
> get this pyClusterROI thing to work with the newer nibabel (which
> replaces pynifty [macports devs:I'll create a ticket later today to
> file these]). You can use the attached nibabel.patch to try it out.
>
> Though, judging by the age of this script, you might find a suitable
> replacement here (which is also where the pynifti replacement lives),
>
> http://nipy.sourceforge.net
>
> Hope that helps!
>
___
macports-users mailing list
macports-users@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo/macports-users