Print

Print


This will remove all contrasts, but is probably the easiest and quickest way.

Removing it from the SPM.mat file (e.g. moving 3 to 2 and then removing the last one) won't change the file names. You'd also need to change the SPM.xCon.fname and also change the filenames themselves.


something along the lines of the following might work.....

load SPM
SPM.xCon=SPM.xCon([contraststokeep]);
for i=1:length(SPM.xCon)
   j=num2str(i);
   if i<10
     A=['000' j];
   elseif i<100
     A=['00' j];
   elseif i<1000
     A=['0' j];
   else
     A=j;
   end
   copyfile(SPM.xCon(i).Vcon.fname,[SPM.xCon(i).Vcon.fname(1:4) A '.img']);
   copyfile([SPM.xCon(i).Vcon.fname(1:8) '.hdr'],[SPM.xCon(i).Vcon.fname(1:4) A '.hdr']);
   copyfile(SPM.xCon(i).Vspm.fname,[SPM.xCon(i).Vspm.fname(1:5) A '.img']);
   copyfile([SPM.xCon(i).Vspm.fname(1:9) '.hdr'],[SPM.xCon(i).Vspm.fname(1:5) A '.hdr']);
   SPM.xCon(i).Vcon.fname=[SPM.xCon(i).Vcon.fname(1:4) A '.img']
   SPM.xCon(i).Vspm.fname=[SPM.xCon(i).Vspm.fname(1:5) A '.img']
end
save SPM.mat SPM
 
Best Regards, Donald McLaren
=================
D.G. McLaren
University of Wisconsin - Madison
Neuroscience Training Program
Office: (608) 520-0586
=====================
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 (608) 520-0586 or email.


On Sat, Jul 10, 2010 at 10:30 AM, Karsten Specht <[log in to unmask]> wrote:
Dear Yune Lee

> I accidentally created a redundant con image
> (e.g., con_0001 and con_0002 are the same)
> which caused the number-off for the newer con
> images for other condition.(i.e.,., the con_0003
> for this subject
>has the same contrast of other's con_0002).
>  I'm trying to remove the redundant structural array
> in the SPM.xCon (see below), but can't quite figure this out.

the easiest way would be to use the contrast manager from the batch options, as this allows you to remove existing contrasts.

Good luck,

Karsten


--
-------------------------------------------------------------
Karsten Specht, PhD

Department of Biological and Medical Psychology
& National Competence Centre for functional MRI
University of Bergen
Jonas Lies vei 91
5009 Bergen
Norway
Tel.: +47-555-86279
Fax: +47-555-89872
[log in to unmask]
http://fmri.uib.no/