Brilliant! I would have never found that doing spm_<tabt><tab> :). Is
this now used throughout SPM5? spm_vol_nifti uses it, but spm_read_vols
I tried this:
warning off; % disable those flipping warnings
warning on; % OK you may complain again
Would that be the right way to copy N1 to N2 and write it? Just copying
the dat field didn't seem to work for copying the voxel data.
John Ashburner wrote:
> Try this:
> N = nifti('fmri_TR2.nii');
> X = N.dat;
> subplot(2,1,1); imagesc(X(:,:,10,4)');
> subplot(2,1,2); plot(squeeze(X(20,20,10,:)))
> but be careful of writing to the file. If you type the following, then you
> get a few more examples that show the other stuff that can be done...
> help nifti/Contents
> All the best,
> On Tuesday 08 April 2008 16:45, Alle Meije Wink wrote:
>> Dear all,
>> Is it possible, with spm command line functions, to read and write 4D
>> NifTI files?
>> with fmri_TR2.nii a 4D NifTI data set, I get an array V of records about
>> the individual volumes in the 4D data set.
>> The fastest way that I know to read data is spm_read_vols, but due to
>> the NifTI record of my file being split into N separate records (???),
>> spm_read_vols only load one volume at a time.
>> For fast reading and writing of 4D data, is there a way to not do this
>> splitting of NifTI records, and load/save the data as a 4D array?
>> Many thanks
>> Alle Meije