Dear Sophie,
If you saved the *_reorient.mat file, you should be able to apply the
transformation it contains to other images by using one of the batch
modules:
SPM > Util > Reorient Images
with the option:
Reorient by > Saved reorientation matrix
Best regards,
Guillaume.
On 02/06/17 20:41, Sophie Betka wrote:
> Dear Spm users,
>
>
>
> For each of my participants, I have a T1 which has been manually
> reoriented to the AC.
>
> I have kept the changes I made (right, forward, up, pitch).
>
> I have also saved the T1 reorientation .mat file.
>
>
>
> I also acquired MRS straight after the structural.
>
> For my analyses, I recreated a binary VOI mask for each of my
> participants (native space, not realigned on AC).
>
>
>
> Because I am doing VBM and would like to create a VOI template (based on
> all my VOI masks), I need to reorient my VOI masks to the AC.
>
>
>
> Is there any way to use the T1 reorientation .mat file in a script and
> reorient my VOI masks?
>
>
>
>
>
> I tried to modify auto_reorient (cf below), but my code is not working.
>
>
>
>
>
> Any help would be very appreciated,
>
>
>
> Best,
>
> Sophie
>
>
>
>
>
>
>
>
>
> --------------------
>
>
>
> functionauto_reorient(p)
>
> spmDir=which('spm');
>
> spmDir=spmDir(1:end-5);
>
> tmpl=[spmDir 'canonical\avg152T1.nii'];
>
> vg=spm_vol(tmpl);
>
> flags.regtype='rigid';
>
> %p=spm_select(inf,'image');
>
> fori=1:size(p,1)
>
> f=strtrim(p(i,:));
>
> spm_smooth(f,'temp.nii',[12 12 12]);
>
> vf=spm_vol('temp.nii');
>
> [M,scal] = spm_affreg(vg,vf,flags);
>
> M3=M(1:3,1:3);
>
> [u s v]=svd(M3);
>
> M3=u*v';
>
> M(1:3,1:3)=M3;
>
> N=nifti(f);
>
> N.mat=M*N.mat;
>
> create(N);
>
> end
>
>
>
>
>
>
>
>
>
>
>
> *Sophie BETKA*
>
> *PhD Student*
> *Clinical Neuropsychologist*
>
>
>
> *Brighton and Sussex Medical School*
>
> /Clinical Imaging Sciences Centre (Brighton, UK)/
>
> University of Sussex, Falmer, BN1 9RR
>
> Trafford Centre, 206.
> Phone : +44 (0)1273.873132 ; # 3132
>
>
>
> *SCALab - Cognitive and Affective Sciences Laboratory*
> /DEEP Team - Emotional Dynamics and Pathology (Lille, FR)/
> Faculté de Medecine, Pôle Recherche
> 1, Place de Verdun, 59045 Lille cedex.
> Phone : +33 (0)3.20.62.68.13
>
>
>
>
> ___________________________________________________________
> This email has been scanned by MessageLabs' Email Security System
> on behalf of the Brighton & Sussex Medical School. For more information see:
> https://staff.brighton.ac.uk/is/computing/Pages/Email/spam.aspx
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|