help > RE: Single subject pre/post treatment analysis
Jun 7, 2014  07:06 AM | Alfonso Nieto-Castanon - Boston University
RE: Single subject pre/post treatment analysis
Hi Helen,

Unfortunately the process you describe is only valid for population-level analyses (with multiple subjects), and it is not really appropriate for single-subject analyses. In your case, in order to perform a single-subject comparison of the seed-to-voxel maps between two conditions you may do this manually from CONN's first-level result files, for example, by using the scripts below (these will implement a simple Fisher-test between two independent correlations):

d1=load('resultsROI_Subject001_Condition001.mat','DOF');
d2=load('resultsROI_Subject001_Condition002.mat','DOF');
se=sqrt(1/max(0,d1.DOF-3)+1/max(0,d2.DOF-3));
files=dir('BETA_Subject1_Condition001_Source*.nii');
sources=cellfun(@(x)sscanf(x,'BETA_Subject1_Condition001_Source%d.nii'),{files.name});

for source=sources
 filenames=arrayfun(@(n)sprintf('BETA_Subject1_Condition%03d_Source%03d.nii',n,source),1:2,'uni',0);
 a=spm_vol(char(filenames));
 z=spm_read_vols(a);
 mask=any(isnan(z),4)|all(z==0,4);
 p=spm_Ncdf((z(:,:,:,2)-z(:,:,:,1))/se); % difference in correlations p-value
 p=2*min(p,1-p); % two-sided p-values
 p(mask)=nan;
 filename=sprintf('p_corr_Subject1_Condition001vsCondition002_Source%03d.nii',source);
 V=struct('mat',a(1).mat,'dim',a(1).dim,'fname',filename,'pinfo',[1;0;0],'n',[1,1],'dt',[spm_type('float32') spm_platform('bigend')]);
 spm_write_vol(V,p);
 p(:)=conn_fdr(p(:));
 filename=sprintf('pFDR_corr_Subject1_Condition001vsCondition002_Source%03d.nii',source);
 V=struct('mat',a(1).mat,'dim',a(1).dim,'fname',filename,'pinfo',[1;0;0],'n',[1,1],'dt',[spm_type('float32') spm_platform('bigend')]);
 spm_write_vol(V,p);
end

Before running this script go to the conn_*/results/firstlevel/ANALYSIS_01 folder. After running the scripts the files p_corr_Subject1_Condition001vsCondition002_Source*.nii will contain the p-values of the between-condition comparison (for each seed/source ROI), and the files pFDR_corr_Subject1_Condition001vsCondition002_Source*.nii will contain the same values after a whole-brain FDR-correction. You may look into the file _list_sources.txt in the same folder to interpret the source numbers in these file names. 

Hope this helps
Alfonso

Originally posted by Helen Carlson:
Hello all,
I would like to do a repeated measures analysis comparing pre/post treatment resting state in a single subject. Is this possible using the CONN toolbox? First I preprocessed my images in SPM. Then I followed previous instructions posted here for comparing sessions that have their own SPM.mat files. I used the posted batch commands to set up my second level covariates for the repeated measures t-test:

n=1;
X=[kron(eye(2),ones(n,1)),kron(ones(2,1),eye(n))];
clear batch;
batch.Setup.subjects.effect_names=[{'Session1'},{'Session2'},arrayfun(@(n)sprintf('within%d',n),1:n,'uni',0)];
batch.Setup.subjects.effects=num2cell(X,1);
conn_batch(batch);

This successfully set up "Session1", "Session2", and "within1" in the 'Setup->Covariates->Second-level' area.

I then ran a paired t-test by entering [1 -1 0] and also [-1 1 0] in the "between subject contrasts" area in the second level results tab. Unfortunately my p-values are all NAN, the Beta's are very small, and the T values are -0.00 or 0.00.

My specific questions:
1. Is it possible to do a single-subject repeated measures resting state analysis (i.e., case study) in CONN?
2. If is it possible, are my results true null results or have I done something wrong?

Thank-you for any assistance you can provide.
Regards,
Helen

Threaded View

TitleAuthorDate
Helen Carlson Jun 5, 2014
RE: Single subject pre/post treatment analysis
Alfonso Nieto-Castanon Jun 7, 2014
Batiah Keissar Nov 19, 2022
Kaitlin Cassady Jun 26, 2015
Alfonso Nieto-Castanon Jun 29, 2015
Nabila BRIHMAT Nov 21, 2020
Nabila BRIHMAT Nov 30, 2020
Johann Philipp Zöllner Jan 24, 2016
Alfonso Nieto-Castanon Jan 25, 2016
Kaitlin Cassady Jun 30, 2015
Alfonso Nieto-Castanon Jul 1, 2015
Kaitlin Cassady Jul 2, 2015
Alfonso Nieto-Castanon Jul 4, 2015
Kaitlin Cassady Jul 6, 2015