<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Michael: Thank you for your speed of response and apologies for taking so long to reply.<br><br>Here is another (small) file of a 4x4x4 cube. The same code causes a segmentation fault (repeated for ease of copy-paste)<br>from nifti import *<br>from numpy import *<br>mynifti = NiftiImage('test4x4x4.nii')<br>myarray = mynifti.getDataArray()<br>myarray<br><br>Thanks, Nick<br><br><br>> Date: Fri, 7 Aug 2009 07:27:27 -0400<br>> From: michael.hanke@gmail.com<br>> To: nick314@hotmail.com<br>> CC: pkg-exppsy-pynifti@lists.alioth.debian.org<br>> Subject: Re: [Pkg-exppsy-pynifti] Converting NiftiImage to ndarray gives "ValueError: dimensions too large"<br>> <br>> Hi Nicholas,<br>> <br>> do you mind sharing the image, so I can check what is going on?<br>> <br>> <br>> Michael<br>> <br>> <br>> On Fri, Aug 07, 2009 at 05:29:26AM +0000, Nicholas Dowson wrote:<br>> > <br>> > Hello,<br>> > <br>> > The following code using pynifti gives me an error (ValueError: dimensions too large):<br>> > from nifti import *<br>> > from numpy import *<br>> > mynifti = NiftiImage('T1noise3bias0.nii')<br>> > myarray = mynifti.getDataArray()<br>> > <br>> > This is very strange because the number of voxels is low:<br>> > In [11]: mynifti.nvox<br>> > Out[11]: 7109137<br>> > In [12]: mynifti.extent<br>> > Out[12]: (181, 217, 181)<br>> > <br>> > Other information:<br>> > I am running Ubuntu 8.10, with the standard packages for python, numpy and scipy installed. I tried the above on ipython and python. Python just segfaults. I get the same error if I use getDataArray()<br>> > <br>> > Here is the full output:<br>> > <BEGIN of output><br>> > ERROR: An unexpected error occurred while tokenizing input<br>> > The following traceback may be corrupted or invalid<br>> > The error message is: ('EOF in multi-line statement', (60, 0))<br>> > <br>> > ---------------------------------------------------------------------------<br>> > ValueError Traceback (most recent call last)<br>> > <br>> > /home/dow178/extDownload/lib/VTKbuild/<ipython console> in <module>()<br>> > <br>> > /var/lib/python-support/python2.5/nifti/niftiimage.pyc in asarray(self, copy)<br>> > 217 """<br>> > 218 # make sure data is accessible<br>> > --> 219 self.load()<br>> > 220 <br>> > 221 if copy:<br>> > <br>> > /var/lib/python-support/python2.5/nifti/niftiimage.pyc in load(self)<br>> > 174 raise RuntimeError, "Unable to load image data."<br>> > 175 <br>> > --> 176 self._data = nifticlib.wrapImageDataWithArray(self.raw_nimg)<br>> > 177 <br>> > 178 <br>> > <br>> > ValueError: dimensions too large.<br>> > <br>> > <END of Output><br>> > <br>> > Does anyone know why this is occuring?<br>> > <br>> > I tried installing the libnifti-dev package and searching for the wrapImageDataWithArray function to glean some information - but it doesn't live there. Any ideas where the c++ source code for wrapImageDataWithArray is?<br>> > <br>> > Many thanks in advance,<br>> > Nick<br>> > <br>> > <br>> > <br>> > <br>> > <br>> > _________________________________________________________________<br>> > Celebrate a decade of Messenger with free winks, emoticons, display pics, and more.<br>> > http://clk.atdmt.com/UKM/go/157562755/direct/01/<br>> <br>> > _______________________________________________<br>> > Pkg-exppsy-pynifti mailing list<br>> > Pkg-exppsy-pynifti@lists.alioth.debian.org<br>> > http://lists.alioth.debian.org/mailman/listinfo/pkg-exppsy-pynifti<br>> <br>> <br>> -- <br>> GPG key: 1024D/3144BE0F Michael Hanke<br>> http://apsy.gse.uni-magdeburg.de/hanke<br>> ICQ: 48230050<br><br /><hr />Windows Live Messenger: Happy 10-Year Anniversary—get free winks and emoticons. <a href='http://clk.atdmt.com/UKM/go/157562755/direct/01/' target='_new'>Get Them Now</a></body>
</html>