Each volume has its own header in a 4D nii file. This is what is stored
in V(i). V(i).n is always different as it notes which volume you are
reading.
In addition, the other two times I've noticed differences, and
remembered) between headers of each volume are:
(1) after motion correction as the correction is applied to the header
and not the data itself;
(2) in the glm process (although those headers are stored in the
SPM.mat file) where each volume gets a scaling factor - if global
scaling is selected then its definitely different for every volume.
Other times the scaling factor could be different as well, although
unlikely.
Best Regards, Donald McLaren
=================
D.G. McLaren, Ph.D.
Postdoctoral Research Fellow, GRECC, Bedford VA
Research Fellow, Department of Neurology, Massachusetts General
Hospital and
Harvard Medical School
Office:
(773) 406-2464
=====================
This e-mail contains CONFIDENTIAL INFORMATION which may contain
PROTECTED
HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is
intended only for the use of the individual or entity named above. If
the
reader of the e-mail is not the intended recipient or the employee or
agent
responsible for delivering it to the intended recipient, you are hereby
notified that you are in possession of confidential and privileged
information. Any unauthorized use, disclosure, copying or the taking of
any
action in reliance on the contents of this information is strictly
prohibited and may be unlawful. If you have received this e-mail
unintentionally, please immediately notify the sender via telephone at
(773)
406-2464 or email.
On Wed, Jan 4, 2012 at 1:14 PM, S.F.W.
Neggers
<[log in to unmask]>
wrote:
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.