Thanks John & Donald!
I didnt notice the matfile yet, and was already quite surprised by this
behavior (the nifti specs indeed indicated 1 header for ND files only,
and I saw many with spm_vol). This explains it all.
In this case, I am done already, as other tools will deal with my
preprocessed DWI data.
Cheers,
Bas
Op 04-01-12 17:35, John Ashburner schreef:
> When you select the files to re-orient, you will need to select the
> volumes within the 4D file to change the orientation of. This
> involves changing the filter in the file selector from "1" to eg
> "1:1000", to allow you to select blah.nii,1 blah.nii,2 etc
>
> The NIfTI headers only have space for a single (complete) affine
> transformation matrix, which is not ideal for motion corrected fMRI
> data etc. For SPM, my solution to this was to generate a separate
> .mat file containing the orientations of the various 3D volumes within
> the NIfTI file. If this .mat file exists, all the orientations of the
> various volumes (other than the first) will be read from the .mat. If
> it doesn't exist, all the orientations will be the same as that of the
> first.
>
> I think in your case, you should be able to delete (or rename) the
> .mat file so that all volumes have the same orientation as the first.
>
> All the best,
> -John
>
> On 4 January 2012 16:27, S.F.W. Neggers<[log in to unmask]> wrote:
>
>> Dear all,
>>
>> I need to reorient (no reslice, header change only) a 4D nifti file.
>> I tried to reorient my 4D nifti file in SPM8, with display (or the batch
>> utils), using a pitch of 90 deg (pi/2 rad). It appeared only the first image
>> in this 4D nifti file had a header that was reoriented, the 2nd till last
>> had the old orientation.
>>
>> I verified this by doing
>>
>> fname='some4Dfile.nii';
>> V=spm_vol(fname);
>>
>>
>> then, V(1).mat had changed, but V(2).mat and onwards didnt.
>>
>> With
>>
>> Data=spm_read_vols(V);
>> for t=2:length(V)
>> V(t).mat=V(1).mat;
>> end
>> spm_write_vols(V,Data);
>>
>> I couldnt fix this, as apparently spm_write_vols cant write 4D data.
>>
>> Any ideas?
>>
>> Cheers,
>>
>> Bas
>>
>> --
>> --------------------------------------------------
>> Dr. S.F.W. Neggers
>> Division of Brain Research
>> Rudolf Magnus Institute for Neuroscience
>> Utrecht University Medical Center
>>
>> Visiting : Heidelberglaan 100, 3584 CX Utrecht
>> Room B.01.1.03
>> Mail : Huispost B01.206, P.O. Box 85500
>> 3508 GA Utrecht, the Netherlands
>> Tel : +31 (0)88 7559609
>> Fax : +31 (0)88 7555443
>> E-mail : [log in to unmask]
>> Web : http://www.neuromri.nl/people/bas-neggers
>> : http://www.neuralnavigator.com (CEO)
>> --------------------------------------------------
>>
>>
>> ------------------------------------------------------------------------------
>>
>> De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is
>> uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht
>> ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct
>> te informeren door het bericht te retourneren. Het Universitair Medisch
>> Centrum Utrecht is een publiekrechtelijke rechtspersoon in de zin van de
>> W.H.W.
>> (Wet Hoger Onderwijs en Wetenschappelijk Onderzoek) en staat geregistreerd
>> bij
>> de Kamer van Koophandel voor Midden-Nederland onder nr. 30244197.
>>
>> Denk s.v.p aan het milieu voor u deze e-mail afdrukt.
>>
>> ------------------------------------------------------------------------------
>>
>> This message may contain confidential information and is intended
>> exclusively
>> for the addressee. If you receive this message unintentionally, please do
>> not
>> use the contents but notify the sender immediately by return e-mail.
>> University
>> Medical Center Utrecht is a legal person by public law and is registered at
>> the Chamber of Commerce for Midden-Nederland under no. 30244197.
>>
>> Please consider the environment before printing this e-mail.
>>
--
--------------------------------------------------
Dr. S.F.W. Neggers
Division of Brain Research
Rudolf Magnus Institute for Neuroscience
Utrecht University Medical Center
Visiting : Heidelberglaan 100, 3584 CX Utrecht
Room B.01.1.03
Mail : Huispost B01.206, P.O. Box 85500
3508 GA Utrecht, the Netherlands
Tel : +31 (0)88 7559609
Fax : +31 (0)88 7555443
E-mail : [log in to unmask]
Web : http://www.neuromri.nl/people/bas-neggers
: http://www.neuralnavigator.com (CEO)
--------------------------------------------------
|