[Pkg-exppsy-pynifti] [Nipy-devel] Image, design, usecases
Matthew Brett
matthew.brett at gmail.com
Wed May 13 22:43:45 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.
Sorry - by the current reader - I meant the version that's sometimes
called 'brifti' or 'volumeimages' in the pynifti repository...
> 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.
No, that's an excellent point. I don't know how the C libraries do
this. The thing that makes this hard is that, if you have an 'int'
data type, and data scaling - as is typical in NIFTI - then you may
well find yourself writing data to disk that requires different
scaling from the first few volumes, and then you have to go back over
the whole dataset to redo it. If you have float or complex images,
this isn't a problem.
As a matter of interest - are you writing to Int type images?
But, thanks, yes, this is a use-case we should think about.
Matthew
More information about the Pkg-exppsy-pynifti
mailing list