Another approach can be used with SPM5. Type the following in MATLAB
for example code...
help nifti/Contents
You can ignore the parts relating to "diminfo", "intent", "timing",
"aux_file" and "cal" - as SPM doesn't actually make use of these.
Note that you can write as well as read voxels very easily. It is
extremely easy to accidentally write values into an image file.
Best regards,
-John
-----Original Message-----
From: SPM (Statistical Parametric Mapping) [mailto:[log in to unmask]]
On Behalf Of Volkmar Glauche
Sent: Sunday, September 09, 2007 3:06 PM
To: [log in to unmask]
Subject: Re: [SPM] array to .img
Dear Anca Sandu,
there is a SPM routine called
spm_write_vol
which should do the job for you. You will need to create a "volume
handle", which is a struct describing dimensions, spatial orientation
... of your volume. You will find help about how to fill these fields
in spm_vol and spm_type.
Volkmar
Zitat von Anca Sandu <[log in to unmask]>:
> I am a doctoral student and I have a question about conversions.
> I generate in Matlab a phantom (3D array of integers - 300x300x300)
and I
> would like to write it to disk in .img format. How can I do it?
> Alternatively, is there a way to convert a .mat file to .img?
> Thank you in advance!
>
> Anca Sandu
>
|