Hello,
my impression is that it might be easier to start with the realignment
parameters themselves. You can use these 6 parameters (describing the
rigid body realignment) to generate a single "total displacement" value
for the whole volume (see Figure 1 in
https://www.ncbi.nlm.nih.gov/pubmed/25333359). For this, an average
cortical distance is required (65 mm is a good guess, see Figure 2),
which you could of course play around with until the whole brain is covered.
Hope this helps,
Marko
Weiying Dai schrieb:
> Dear Dr. Ashburner or other SPMers:
>
> I have a 4D fMRI file, for instance, it is called data.nii. I want to
> calculate one-dimensional motion regressor (from SPM realignment) for
> resting-state fMRI, which is the sum of squared distance divided by the
> number of voxels. I am trying to calculate each voxel's world coordinate
> at each time point (e.g. second time point).
>
> After realignment using SPM8, it generates data.mat, which is the 4*4
> transformation matrix (let us call it M) for all the time points (the
> first transformation matrix is zeros matrix because the first volume was
> considered as the reference in the realignment).
>
> For the second time point, the transformation matrix is M(:, :, 2). M(:,
> :, 2) multiplied by [x, y, z, 1]' (in voxel space with dimension of
> [xres, yres, zres] ) should give the world coordinate for the voxel. I
> assume this is right. Please let me know if you think it differently.
>
> For the first time point, the transformation matrix is 4 * 4 zero
> matrix. How should I derive the world coordinate for each voxel [x, y,
> z, 1]? I thought that I should read the header for the transformation
> matrix (see below). I append [0 0 0 1] as the fourth row to form 4 * 4
> matrix. The calculation makes sense to me.
> srow_x: [-1.8750 1.8096e-20 1.4900e-19 118.1620]
> srow_y: [8.8745e-20 1.8750 -4.3816e-19 -118.1860]
> srow_z: [9.5190e-20 8.4778e-20 4.0000 -60.0980]
>
> But when I read some of SPM documents, only when sform_code (in the
> header) is not equal to 0, I can use the srow_x, srow_y, and srow_z as
> transformation matrix. But I have both qform_code= 0 and sform_code: 0
> in the header.
>
> Any thoughts are welcome for my calculation of one-dimensional motion
> regressor.
>
> Thanks in advance,
> Weiying
>
>
>
>
--
____________________________________________________
Prof. Dr. med. Marko Wilke
Facharzt für Kinder- und Jugendmedizin
Leiter, Experimentelle Pädiatrische Neurobildgebung
Oberarzt der Abteilung Neuropädiatrie
Universitäts-Kinderklinik
Marko Wilke, MD, PhD
Pediatrician
Head, Experimental Pediatric Neuroimaging
Consultant in Pediatric Neurology
University Children's Hospital
Hoppe-Seyler-Str. 1
D - 72076 Tübingen, Germany
Tel. +49 7071 29-83416
Fax +49 7071 29-5473
[log in to unmask]
http://www.medizin.uni-tuebingen.de/kinder/epn/
____________________________________________________
|