If you realign the magnitude images, the transformation matrices will
be written into the headers. You can copy these matrices from the
magnitude to the phase images using a piece of MATLAB code similar to
what follows....
Pmag=spm_select(Inf,'nifti'); % Select magnitude images
N = size(Pmag,1); % Number of scans
Ppha=spm_select(N,'Nifti'); % Select phase images
for i=1:N,
M = spm_get_space(Pmag(i,:)); % Read matrix
spm_get_space(Ppha(i,:),M); % Write matrix
end
Best regards,
-John
On 23 November 2012 13:50, Tyson, Adam <[log in to unmask]> wrote:
> Dear All,
>
> I am looking for a way to carry out motion correction on magnitude images, and then apply this same correction to the corresponding phase images.
>
> Is there a way to get a simple transformation matrix for each volume from the magnitude motion correction to apply to the phase?
>
> Many Thanks,
>
> Adam Tyson
|