help > first level threshold
Showing 1-8 of 8 posts
Display:
Results per page:
Oct 18, 2011  12:10 AM | Sarah Buetof
first level threshold
Hey,
Sorry, that might be a stupid question, but are the first level results already somehow thresholded or FWE corrected?

Thanks for helping me out
Oct 18, 2011  03:10 PM | Alfonso Nieto-Castanon - Boston University
RE: first level threshold
Hi Sarah,

The first-level results shown in the 'first-level analysis' tab are only thresholded based on effect size (e.g. correlation coefficient values), but this is only done for display purposes and it does not support any form of statistical inference on the single-subject results (and of course no threshold is used when passing the the first-level results to the second-level analyses). In previous versions of the toolbox (conn12) we supported fixed-effect analyses of single-subject data (those would appear in the 'second-level results' tab, selecting 'fixed-effects' instead of 'random-effects'). Those analyses used Fisher approximation of the seed-to-voxel or ROI-to-ROI BOLD signal correlations to perform inferences at the level of the individual subject results (e.g. that may be used for single-subject studies), but sadly we had to drop that functionality from the last version due to time constrains (if there is enough user interest I might get around to update that functionality back into the toolbox). In any way, if you are interested in obtaining single-subject statistics (and are willing to do some matlab coding) let me know and I will let you know the specifics of how you could do that with the current setup. 

Best
Alfonso

Originally posted by Sarah Buetof:
Hey,
Sorry, that might be a stupid question, but are the first level results already somehow thresholded or FWE corrected?

Thanks for helping me out
Oct 19, 2011  06:10 AM | Sarah Buetof
RE: first level threshold
Hi Alfonso,
Thanks for your quick answer.
We are planning to use the first level r-maps in another analysis and they should be corrected for multiple comparisons.
The fixed-effect analysis in 12 does not work and I get following error message:

Step 1/2: Functional data second-level analyses
62.5% ??? Reference to non-existent field 'csources'.

Error in ==> conn_process at 1467
                    csources=SPMall(n1).connvols.csources;

Error in ==> conn_process at 18
        case 'results',         conn_process(14:15,varargin{:});

Error in ==> conn at 1601
                conn_process('results');

Error in ==> conn_menumanager at 112
                            feval(MM.MENU{n0}.callback{n1}{1},MM.MENU{n0}.callback{n1}{2:end});
??? Error while evaluating figure WindowButtonUpFcn


Somebody else already mentioned that error and you provided another conn_process.m file that should solve the problem. But that didn't work for me, too.
We could implement a threshold in the script for our further analysis, but therefore we need the p-values.
Do you have any suggestions how to deal with that issue?
Does it makes more sense to try to fix the problem with version 12 or to do the statitics with matlab with the 13-results? Since I am not very familiar with matlab yet, I would prefer the first way, if that provides the results I am looking for.

Thanks
Oct 23, 2011  07:10 PM | Alfonso Nieto-Castanon - Boston University
RE: first level threshold
Hi Sarah,

One simple general way I could recommend to obtain seed-to-voxel first-level connectivity maps corrected for multiple comparisons would be to use Fisher approximation to the standard error of correlation coefficient estimates to obtain first uncorrected p-values for each voxel, and then apply an FDR-correction to obtain FDR-corrected p-values. The simplest way to approximate the standard error of the seed-to-voxel correlations would be assuming non-colored noise over the (typically small) frequency band defined during the preprocessing step (this is the same approach used by the previous version of the toolbox when using fixed-effect analyses; alternatively you could also use Welch-Satterthwaite approximation for a more precise result but that would require estimating the spectra of the residuals first).

In any way, if you have already run the setup/preprocessing/first-level analyses (and obtained in this way fisher-transformed BETA_Subject*_Condition*_Source*.nii files; one map for each source/condition/subject), you could easily transform these files to the associated uncorrected and FDR-corrected p-values (following the approach described above) using the following script:


nsub=1;       % subject number
ncondition=1; % condition number
nroi=1;       % source/seed number
nanalysis=1;  % analysis number

global CONN_x;
filepath=CONN_x.folders.preprocessing;
filepathresults=fullfile(CONN_x.folders.firstlevel,CONN_x.Analyses(nanalysis).name);
filename=fullfile(filepath,['DATA_Subject',num2str(nsub,'%03d'),'_Condition',num2str(ncondition,'%03d'),'.mat']);
Y=conn_vol(filename);
DOF=max(0,Y.size.Nt*(min(1/(2*CONN_x.Setup.RT),CONN_x.Preproc.filter(2))-max(0,CONN_x.Preproc.filter(1)))*(2*CONN_x.Setup.RT)+1);
filename=fullfile(filepathresults,['BETA_Subject',num2str(nsub),'_Condition',num2str(ncondition,'%03d'),'_Source',num2str(nroi,'%03d'),'.nii']);
a=spm_vol(filename);
Z=spm_read_vols(a);          % fisher-transformed correlation values
z=Z*max(0,sqrt(DOF-3));    % z-scores
p=spm_Ncdf(z);                  % p-values from normal distribution
p=2*min(p,1-p);                 % note: two-sided tests (remove this line for one-sided tests; i.e. only positive correlations)
P=p;
P(:)=conn_fdr(p(:));            % FDR-corrected p-values
a.fname=fullfile(filepathresults,['p_Subject',num2str(nsub),'_Condition',num2str(ncondition,'%03d'),'_Source',num2str(nroi,'%03d'),'.nii']);
spm_write_vol(a,p);
a.fname=fullfile(filepathresults,['pFDR_Subject',num2str(nsub),'_Condition',num2str(ncondition,'%03d'),'_Source',num2str(nroi,'%03d'),'.nii']);
spm_write_vol(a,P);


This will create two files:

   p_Subject1_Condition1_Source1.nii 
   pFDR_Subject1_Condition1_Source1.nii

with the uncorrected and FDR-corrected p-values, respectively, of the seed-to-voxel maps for the first subject/condition/source (edit the first four lines to change the subject/condition/source numbers of interest)

Hope this helps, and let me know if this addresses your question. You might need to do something more complex if you want to look instead at more complex contrasts across conditions or sources, let me know.

Best
Alfonso

Originally posted by Sarah Buetof:
Hi Alfonso,
Thanks for your quick answer.
We are planning to use the first level r-maps in another analysis and they should be corrected for multiple comparisons.
The fixed-effect analysis in 12 does not work and I get following error message:

Step 1/2: Functional data second-level analyses
62.5% ??? Reference to non-existent field 'csources'.

Error in ==> conn_process at 1467
                    csources=SPMall(n1).connvols.csources;

Error in ==> conn_process at 18
        case 'results',         conn_process(14:15,varargin{:});

Error in ==> conn at 1601
                conn_process('results');

Error in ==> conn_menumanager at 112
                            feval(MM.MENU{n0}.callback{n1}{1},MM.MENU{n0}.callback{n1}{2:end});
??? Error while evaluating figure WindowButtonUpFcn


Somebody else already mentioned that error and you provided another conn_process.m file that should solve the problem. But that didn't work for me, too.
We could implement a threshold in the script for our further analysis, but therefore we need the p-values.
Do you have any suggestions how to deal with that issue?
Does it makes more sense to try to fix the problem with version 12 or to do the statitics with matlab with the 13-results? Since I am not very familiar with matlab yet, I would prefer the first way, if that provides the results I am looking for.

Thanks
Oct 31, 2011  04:10 AM | Sarah Buetof
RE: first level threshold
That's exactly what we needed. Thank you!
Jan 17, 2014  10:01 AM | Erin Mazerolle
RE: first level threshold
Hello,

Thanks for this toolbox and the support on the forum! I'm interested in obtaining voxel-to-voxel first-level connectivity maps corrected for multiple comparisons. Is the approach you outlined for seed-to-voxel maps also relevant to voxel-to-voxel maps?

Thanks!
Erin
Jan 22, 2019  02:01 PM | Matthew Heard - The Ohio State University
RE: first level threshold
Hi all,

Alfonso, you mentioned needing to do something more complex in order to compare results from a single subject across multiple conditions or sessions. Unfortunately this is exactly what I would like to accomplish. Has anyone had success computing effects across sessions with one subject?

Thanks,
Matthew
Feb 6, 2019  11:02 AM | Bastien Guerin - Massachusetts General Hospital
RE: first level threshold
Hello -- this is a follow up on the post below. I have used the Matlab code provided by Alfonso to compute FDR-corrected p-value maps on individual subjects. However, they look completely different from the CONN GUI first-level analyses tab display (see screenshot attached: LEFT: 1-tail FDR-corrected p-value from Alfonso's Matlab code previously posted below, MIDDLE: 2-tail FDR-corrected p-value map from Matlab code posted below, RIGHT: CONN GUI first-level display).

This does not inspire confidence and makes me think I have messed up somewhere. Shouldn't the standalone Matlab code and the CONN first-level GUI agree?

Thanks -- Bastien

Originally posted by Alfonso Nieto-Castanon:
Hi Sarah,

One simple general way I could recommend to obtain seed-to-voxel first-level connectivity maps corrected for multiple comparisons would be to use Fisher approximation to the standard error of correlation coefficient estimates to obtain first uncorrected p-values for each voxel, and then apply an FDR-correction to obtain FDR-corrected p-values. The simplest way to approximate the standard error of the seed-to-voxel correlations would be assuming non-colored noise over the (typically small) frequency band defined during the preprocessing step (this is the same approach used by the previous version of the toolbox when using fixed-effect analyses; alternatively you could also use Welch-Satterthwaite approximation for a more precise result but that would require estimating the spectra of the residuals first).

In any way, if you have already run the setup/preprocessing/first-level analyses (and obtained in this way fisher-transformed BETA_Subject*_Condition*_Source*.nii files; one map for each source/condition/subject), you could easily transform these files to the associated uncorrected and FDR-corrected p-values (following the approach described above) using the following script:


nsub=1;       % subject number
ncondition=1; % condition number
nroi=1;       % source/seed number
nanalysis=1;  % analysis number

global CONN_x;
filepath=CONN_x.folders.preprocessing;
filepathresults=fullfile(CONN_x.folders.firstlevel,CONN_x.Analyses(nanalysis).name);
filename=fullfile(filepath,['DATA_Subject',num2str(nsub,'%03d'),'_Condition',num2str(ncondition,'%03d'),'.mat']);
Y=conn_vol(filename);
DOF=max(0,Y.size.Nt*(min(1/(2*CONN_x.Setup.RT),CONN_x.Preproc.filter(2))-max(0,CONN_x.Preproc.filter(1)))*(2*CONN_x.Setup.RT)+1);
filename=fullfile(filepathresults,['BETA_Subject',num2str(nsub),'_Condition',num2str(ncondition,'%03d'),'_Source',num2str(nroi,'%03d'),'.nii']);
a=spm_vol(filename);
Z=spm_read_vols(a);          % fisher-transformed correlation values
z=Z*max(0,sqrt(DOF-3));    % z-scores
p=spm_Ncdf(z);                  % p-values from normal distribution
p=2*min(p,1-p);                 % note: two-sided tests (remove this line for one-sided tests; i.e. only positive correlations)
P=p;
P(:)=conn_fdr(p(:));            % FDR-corrected p-values
a.fname=fullfile(filepathresults,['p_Subject',num2str(nsub),'_Condition',num2str(ncondition,'%03d'),'_Source',num2str(nroi,'%03d'),'.nii']);
spm_write_vol(a,p);
a.fname=fullfile(filepathresults,['pFDR_Subject',num2str(nsub),'_Condition',num2str(ncondition,'%03d'),'_Source',num2str(nroi,'%03d'),'.nii']);
spm_write_vol(a,P);


This will create two files:

   p_Subject1_Condition1_Source1.nii 
   pFDR_Subject1_Condition1_Source1.nii

with the uncorrected and FDR-corrected p-values, respectively, of the seed-to-voxel maps for the first subject/condition/source (edit the first four lines to change the subject/condition/source numbers of interest)

Hope this helps, and let me know if this addresses your question. You might need to do something more complex if you want to look instead at more complex contrasts across conditions or sources, let me know.

Best
Alfonso

Originally posted by Sarah Buetof:
Hi Alfonso,
Thanks for your quick answer.
We are planning to use the first level r-maps in another analysis and they should be corrected for multiple comparisons.
The fixed-effect analysis in 12 does not work and I get following error message:

Step 1/2: Functional data second-level analyses
62.5% ??? Reference to non-existent field 'csources'.

Error in ==> conn_process at 1467
                    csources=SPMall(n1).connvols.csources;

Error in ==> conn_process at 18
        case 'results',         conn_process(14:15,varargin{:});

Error in ==> conn at 1601
                conn_process('results');

Error in ==> conn_menumanager at 112
                            feval(MM.MENU{n0}.callback{n1}{1},MM.MENU{n0}.callback{n1}{2:end});
??? Error while evaluating figure WindowButtonUpFcn


Somebody else already mentioned that error and you provided another conn_process.m file that should solve the problem. But that didn't work for me, too.
We could implement a threshold in the script for our further analysis, but therefore we need the p-values.
Do you have any suggestions how to deal with that issue?
Does it makes more sense to try to fix the problem with version 12 or to do the statitics with matlab with the 13-results? Since I am not very familiar with matlab yet, I would prefer the first way, if that provides the results I am looking for.

Thanks
Attachment: prob_CONN.png