<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hello,<br><br>The following code using pynifti gives me an error (ValueError: dimensions too large):<br><i>from nifti import *<br>from numpy import *<br>mynifti = NiftiImage('T1noise3bias0.nii')<br>myarray = mynifti.getDataArray()<br></i><br>This is very strange because the number of voxels is low:<br><i>In [11]: mynifti.nvox<br>Out[11]: 7109137<br>In [12]: mynifti.extent<br>Out[12]: (181, 217, 181)</i><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>&lt;BEGIN of output&gt;<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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Traceback (most recent call last)<br><br>/home/dow178/extDownload/lib/VTKbuild/&lt;ipython console&gt; in &lt;module&gt;()<br><br>/var/lib/python-support/python2.5/nifti/niftiimage.pyc in asarray(self, copy)<br>&nbsp;&nbsp;&nbsp; 217&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; """<br>&nbsp;&nbsp;&nbsp; 218&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # make sure data is accessible<br>--&gt; 219&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.load()<br>&nbsp;&nbsp;&nbsp; 220 <br>&nbsp;&nbsp;&nbsp; 221&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if copy:<br><br>/var/lib/python-support/python2.5/nifti/niftiimage.pyc in load(self)<br>&nbsp;&nbsp;&nbsp; 174&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; raise RuntimeError, "Unable to load image data."<br>&nbsp;&nbsp;&nbsp; 175 <br>--&gt; 176&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self._data = nifticlib.wrapImageDataWithArray(self.raw_nimg)<br>&nbsp;&nbsp;&nbsp; 177 <br>&nbsp;&nbsp;&nbsp; 178 <br><br>ValueError: dimensions too large.<br><br>&nbsp;&lt;END of Output&gt;<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 /><hr />Windows Live Messenger: Celebrate 10 amazing years with free winks and emoticons. <a href='http://clk.atdmt.com/UKM/go/157562755/direct/01/' target='_new'>Get Them Now</a></body>
</html>