thanks!
But as it appeared I do not have a problem afterall. This only changes
the mat file John was talking about.
In a 4D nifti file there only is one header with one voxel-to-world
mapping really.
When deleting the ensuing matfile everything behaves normally (I will
use the data in another non-matlab based package).
CHeers,
Bas
Op 04-01-12 19:05, Jose Vicente Manjon Herrera schreef:
> try this!
>
> Data=spm_read_vols(V);
> for t=2:length(V)
> V(t).mat=V(1).mat;
> spm_write_vols(V(t),Data(:,:,:,t));
> end
>
> hope this helps
>
> Jose
>
>
> Mensaje citado por "S.F.W. Neggers"<[log in to unmask]>:
>
>
>> 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)
--------------------------------------------------
|