[Pkg-exppsy-pynifti] [Nipy-devel] Image, design, usecases

Souheil Inati souheil.inati at nyu.edu
Wed May 13 22:35:31 UTC 2009


Hi,

I know that the current reader pynifti (wrapper around nifti clib)  
does most of what I want.  But I thought that this conversation was  
around rewriting everything in pure python, in which case I can't tell  
what of the current functionality of pynifti will be kept.

That said, from my somewhat limited experimentation with pynifti there  
are some things that I can't figure out how to do cleanly.  For  
example: in my recon code, I almost always want to do incremental  
writing.  In matlab, using my wrappers around the nifti clib (http://cbi.nyu.edu/software/niftimatlab 
), I create a header, fill it, and write it to disk, and then I have a  
for loop where I grab raw data, reconstruct a volume and then write  
that volume to disk.  This way of doing it:

> img = Nifti1Image(data, affine)
> img.to_filespec('somefile.nii')


requires that I compute all of the data first.  Perhaps I am being  
clueless.

-Souheil

On May 13, 2009, at 3:46 PM, Matthew Brett wrote:

> Hi,
>
>> The only real essentials are:
>>  - basic file handling: open, seek, read, write, close
>>  - proper handling of the header : some validation is nice. I don't
>> really care about the extensible part of the header.
>>
>> Memory mapping mapping as an numpy array would be great, but not a
>> requirement.  Only supporting uncompressed versions is fine too.
>> Anything that restricts you to 4D is bad from my perspective.
>
> Um - at the moment, you never see file handling.  I mean that, if you
> have some data, and want to put it into and image and save it, it
> goes:
>
> img = Nifti1Image(data, affine)
> img.to_filespec('somefile.nii')
>
> The current readers, writers support complex data, 64 and 128 bit.
> There's some header validation on load with output to stderr or
> arbitrary logging location.    We do memory mapping when we can
> (uncompressed float read).  The readers and writers do compression /
> uncompression automatically.  There's no restriction on number of
> dimensions structurally, but I haven't tested it with more than 4D...
>
> See you,
>
> Matthew
> _______________________________________________
> Nipy-devel mailing list
> Nipy-devel at neuroimaging.scipy.org
> http://mail.scipy.org/mailman/listinfo/nipy-devel




More information about the Pkg-exppsy-pynifti mailing list