wanderine / BROCCOLI

BROCCOLI: Software for Fast fMRI Analysis on Many-Core CPUs and GPUs
GNU General Public License v3.0
113 stars 38 forks source link

Support for more than one run #13

Closed wanderine closed 8 years ago

ImmanuelSamuel commented 8 years ago

Is this going to be supported in the near future? Is there an alternate way to mimic this with current BROCCOLI version?

wanderine commented 8 years ago

Yes another user is also requesting it.

2015-08-17 15:09 GMT+02:00 ImmanuelSamuel notifications@github.com:

Is this going to be supported in the near future?

— Reply to this email directly or view it on GitHub https://github.com/wanderine/BROCCOLI/issues/13#issuecomment-131813162.

Anders Eklund, PhD

ImmanuelSamuel commented 8 years ago

Any idea on when you will be able to release it? I need to meet my deadline in a month and so i might start using FSL if this is going to take a long time.

wanderine commented 8 years ago

I will try to include it this week.

2015-08-17 15:43 GMT+02:00 ImmanuelSamuel notifications@github.com:

Any idea on when you will be able to release it? I need to meet my deadline in a month and so i might start using FSL if this is going to take a long time.

— Reply to this email directly or view it on GitHub https://github.com/wanderine/BROCCOLI/issues/13#issuecomment-131821223.

Anders Eklund, PhD

wanderine commented 8 years ago

I have now added support for several runs, and hope that I have found all the new bugs.

To get the update, do a "git pull" in a linux terminal, while being in a BROCCOLI directory. If you can't use the precompiled functions, go to BROCCOLI/code/Bash_Wrapper and run recompile.sh

For each run, 4 detrending regressors are added that are only "ON" for the duration of that run. Each run can have a separate number of volumes. An arbitrary number of runs is supported. The general syntax is

FirstLevelAnalysis -runs 3 run1.nii run2.nii run3.nii T1.nii MNI.nii regressors1.txt regressors2.txt regressors3.txt contrasts.txt

(if you only have 1 run you use the old syntax FirstLevelAnalysis run1.nii T1.nii MNI.nii regressors.txt contrasts.txt)

If there is one or several runs for which the subject did not do a certain task, you can simply add a dummy regressor text file, e.g. if you have 3 runs and the subject performed 2 tasks, but only performed one task for the last run, the regressor files can look like

regressors1.txt:

NumRegressors 2

taskA_run1.txt taskB_run1.txt

regressors2.txt:

NumRegressors 2

taskA_run2.txt taskB_run2.txt

regressors3.txt:

NumRegressors 2

dummy.txt taskB_run3.txt

where dummy.txt only contains "NumEvents 0"

Make use of -savedesignmatrix and -saveoriginaldesignmatrix to check if the design matrix looks as expected (e.g. 1dplot total_designmatrix.txt, where 1dplot is an AFNI function)

2015-08-17 16:01 GMT+02:00 Anders Eklund andek034@gmail.com:

I will try to include it this week.

2015-08-17 15:43 GMT+02:00 ImmanuelSamuel notifications@github.com:

Any idea on when you will be able to release it? I need to meet my deadline in a month and so i might start using FSL if this is going to take a long time.

— Reply to this email directly or view it on GitHub https://github.com/wanderine/BROCCOLI/issues/13#issuecomment-131821223.

Anders Eklund, PhD

Anders Eklund, PhD

ImmanuelSamuel commented 8 years ago

Would it be possible to add an ouput directory argument where the results can get saved?

wanderine commented 8 years ago

That option exists for other BROCCOLI function, but for some reason not yet for FirstLevelAnalysis. I will add it.

2015-08-20 0:21 GMT+02:00 ImmanuelSamuel notifications@github.com:

Would it be possible to add an ouput directory argument where the results can get saved?

— Reply to this email directly or view it on GitHub https://github.com/wanderine/BROCCOLI/issues/13#issuecomment-132805526.

Anders Eklund, PhD

wanderine commented 8 years ago

I have now added -output option for FirstLevelAnalysis, if you for example run

FirstLevelAnalysis -runs 3 bold1.nii.gz bold2.nii.gz bold3.nii.gz brain.nii.gz MNI152_T1_2mm_brain.nii.gz regressors1.txt regressors2.txt regressors3.txt contrasts.txt -output /home/andek/Data/subject1

all the results will be saved in the directory /home/andek/Data , and all the files will start with subject1

ImmanuelSamuel commented 8 years ago

That works well. How do you do higher level analysis after this. FSL asks for registration before running higher level. Since the directory structure is different it complains.

wanderine commented 8 years ago

I don't know if you can run the group analysis through the FSL GUI, the registration has already been done in the FirstLevelAnalysis (all results are in MNI space).

You can use randomise in FSL to run a permutation test. First merge the beta/cope image for each subject into a single nifti file

fslmerge -t allcopes.nii.gz subject*_cope1.nii.gz

then run randomise, e.g. for simple group mean

randomise -i allcopes.nii.gz -o permtest -1 -c 2.3 -m /usr/local/fsl/data/standard/MNI152_T1_2mm_brain_mask.nii.gz


In BROCCOLI you can use the function RandomiseGroupLevel, which also performs a permutation test (like randomise in FSL).

RandomiseGroupLevel allcopes.nii.gz -groupmean -mask /usr/local/fsl/data/standard/MNI152_T1_2mm_brain_mask.nii.gz -cdt 2.5


Both randomise and RandomiseGroupLevel will generate new nifti files which contain p-values for each voxel/cluster. Note that these p-values are actually 1-p, so a value of 0.95 corresponds to p = 0.05 (corrected for multiple comparisons).

2015-08-20 17:12 GMT+02:00 ImmanuelSamuel notifications@github.com:

That works well. How do you do higher level analysis after this. FSL asks for registration before running higher level. Since the directory structure is different it complains.

— Reply to this email directly or view it on GitHub https://github.com/wanderine/BROCCOLI/issues/13#issuecomment-133044781.

Anders Eklund, PhD

wanderine commented 8 years ago

See the following paper on permutation tests in neuroimaging, I prefer non-parametric statistics as a permutation test as it is based on a lower number of assumptions compared to parametric statistical methods

http://www.fil.ion.ucl.ac.uk/spm/doc/papers/NicholsHolmes.pdf

2015-08-20 17:30 GMT+02:00 Anders Eklund andek034@gmail.com:

I don't know if you can run the group analysis through the FSL GUI, the registration has already been done in the FirstLevelAnalysis (all results are in MNI space).

You can use randomise in FSL to run a permutation test. First merge the beta/cope image for each subject into a single nifti file

fslmerge -t allcopes.nii.gz subject*_cope1.nii.gz

then run randomise, e.g. for simple group mean

randomise -i allcopes.nii.gz -o permtest -1 -c 2.3 -m /usr/local/fsl/data/standard/MNI152_T1_2mm_brain_mask.nii.gz


In BROCCOLI you can use the function RandomiseGroupLevel, which also performs a permutation test (like randomise in FSL).

RandomiseGroupLevel allcopes.nii.gz -groupmean -mask /usr/local/fsl/data/standard/MNI152_T1_2mm_brain_mask.nii.gz -cdt 2.5


Both randomise and RandomiseGroupLevel will generate new nifti files which contain p-values for each voxel/cluster. Note that these p-values are actually 1-p, so a value of 0.95 corresponds to p = 0.05 (corrected for multiple comparisons).

2015-08-20 17:12 GMT+02:00 ImmanuelSamuel notifications@github.com:

That works well. How do you do higher level analysis after this. FSL asks for registration before running higher level. Since the directory structure is different it complains.

— Reply to this email directly or view it on GitHub https://github.com/wanderine/BROCCOLI/issues/13#issuecomment-133044781.

Anders Eklund, PhD

Anders Eklund, PhD