I've run into something that I need a bit of clarification on in the NiftiImage lib. Specifically in the updateNiftiHeaderFromDict method.
Line 238 of utils.py throws an exception if the data_type field is > 9. From my reading of the nifti spec and parsing of the raw header file, this field appears to be a char[10]. (char data_type[10]). Where'd the other byte go? -james On Mar 20, 2009, at 1:42 PM, Michael Hanke wrote: > Hi James, > > On Fri, Mar 20, 2009 at 01:32:30PM -0700, James Kyle wrote: >> Greetings, >> >> I'm writing an application that'll receive a nifti image over a >> socket >> connection. Once received, it's going to pass it off to analysis >> framework. >> I'm using twisted for the networking, which receives data as a Python >> string object. >> >> As I understand the API, NiftiImage accepts either an actual file >> or a >> numpy array + header dict as valid arguments. I wish to avoid >> unnecessary disk I/O, so I'm going to subclass NiftiImage to accept >> raw data as an argument in the form of a string or a stream. >> >> Before I set out to do so, I wanted to make sure I haven't missed a >> means of doing this already present in the library. > > I don't think that anything that is in there already could do that. > However, maybe we can get away without a subclass. You'd only have to > get a string representation of the header and the image data, turn > them > into an array and a dict and feed that to the constructor. So it could > simply be another helper function that could be linked into > __init__(). > > What do you think? > > Needless to mention that I'd be happy to accept patches and merge that > feature in pynifti. > > Cheers, > > Michael > > -- > GPG key: 1024D/3144BE0F Michael Hanke > http://apsy.gse.uni-magdeburg.de/hanke > ICQ: 48230050 > > _______________________________________________ > Pkg-ExpPsy-PyMVPA mailing list > [email protected] > http://lists.alioth.debian.org/mailman/listinfo/pkg-exppsy-pymvpa _______________________________________________ Pkg-ExpPsy-PyMVPA mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/pkg-exppsy-pymvpa

