Dear Nicolas,
assuming that you are using SPM2 adding contrast can be done in the
following way (on the MATLAB prompt):
ctype = 'T'; % or 'F' if you want to specify an F-contrast
c = [...] % here you define your contrast vector (if T-contrast) or
% contrast matrix (if F-contrast)
cname = 'XXX' % the name of your contrast
load(spm_get(1,'SPM.mat','Select SPM.mat')
if strcmp(ctype,'T')
SPM.xCon(end+1) = spm_FcUtil('Set',cname,ctype,'c',c(:),SPM.xX.xKXs);
elseif strcmp(ctype,'F')
SPM.xCon(end+1) = spm_FcUtil('Set',cname,ctype,'c',c',SPM.xX.xKXs);
end
spm_defaults % always good to do, e.g. for getting default.analyze.flip
spm_contrasts(SPM) % estimate remaining contrasts
Of course, if you have more than one contrast to add you can loop over
the assignment to SPM.xCon and call spm_contrasts after the loop. This
way ALL new contrasts will be estimated.
Hope this helps.
Jan
On 2005-03-29 (Tue) at 15:51:39 -0500, Nicholas Masse <[log in to unmask]> wrote:
> Hi everyone.
>
> I was just wondering if it is possible to add additional contrasts (both F and T contrasts) using a BATCH command, to a design model that already has a number of contrasts defined?
>
> Thanks.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Nicholas Masse, M.Sc.
> Research Technician
> Neurovascular Research Lab
> School of Kinesiology
> University of Western Ontario
> Rm. 3110 Thames Hall
> 519.661.2111 x88526
> [log in to unmask]
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
Jan Gläscher Neuroimage Nord
+49-40-42803-7890 (office) Dept. of Neurology, Bldg S10
+49-40-42803-9955 (fax) University Medical Center Hamburg-Eppendorf
[log in to unmask] Martinistr. 52
20246 Hamburg
Germany
http://www.uke.uni-hamburg.de/kliniken/neurologie/index_16969.php
---------------------------------------------------------------------------
GnuPG/PGP key id: FEC4B55C
fingerprint: 5A36 1EF6 8472 117E 805A F240 3146 A410 FEC4 B55C
---------------------------------------------------------------------------
|