
Experiment Configuration and Data Analysis for fMRI Preprocessing and Analysis
Configure and create files containing experiment information, link subjects to functional/anatomical files, define session designs, preprocessing steps, model information, contrasts of interest, and run scripts for importing, preprocessing, and analyzing fMRI data.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
FrankLab fMRI preprocessing/QA/first-level analysis scripts
Summary Create configuration files containing all relevant info about your experiment SubjectInfoData.cfg (one per subject) point to functional/anatomical files; session design files SessionInfo.cfg (one per different session/run) condition names, onsets/durations PreprocInfo.cfg Preprocessing steps & details ModelInfo.cfg Model name, contrasts of interest Run FL scripts to import/preprocess/analyze your data fl PREPROC fl MODEL fl QACREATE fl QAPLOT
Summary Create configuration files containing all relevant info about your experiment SubjectInfoData.cfg (one per subject) point to functional/anatomical files; session design files SessionInfo.cfg (one per different session/run) condition names, onsets/durations PreprocInfo.cfg Preprocessing steps & details ModelInfo.cfg Model name, contrasts of interest Run FL scripts to import/preprocess/analyze your data fl PREPROC fl MODEL fl QACREATE fl QAPLOT
fl('PREPROC',...) runs preprocessing steps Configuration (.cfg) file format e.g. %% EXAMPLE .CFG FILE DEFINING SOURCE DATA FILES AND MODEL INFORMATION %% see "help fl_process" for details %% Comments (start by %) #functionals /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/functionals/ACE9001_run00_61.nii /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/functionals/ACE9001_run01_63.nii /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/functionals/ACE9001_run02_65.nii /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/functionals/ACE9001_run03_67.nii #RT 2 #structurals /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/mprage/ACE9001_run00_09.nii #design /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_subjectDesign/SubjectDesign_ACE9001.cfg % or (alternative syntax): % #design.runs 1 2 3 4 % #design.files % /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_sessionDesign/ACE9001_SessionDesignA.cfg % /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_sessionDesign/ACE9001_SessionDesignB.cfg % /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_sessionDesign/ACE9001_SessionDesignC.cfg % /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_sessionDesign/ACE9001_SessionDesignD.cfg
fl('PREPROC',...) runs preprocessing steps Configuration (.cfg) file format e.g. %% EXAMPLE .CFG FILE DEFINING SOURCE DATA FILES AND MODEL INFORMATION %% see "help fl_process" for details %% Field names (start by #) #functionals /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/functionals/ACE9001_run00_61.nii /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/functionals/ACE9001_run01_63.nii /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/functionals/ACE9001_run02_65.nii /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/functionals/ACE9001_run03_67.nii #RT 2 #structurals /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/mprage/ACE9001_run00_09.nii #design /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_subjectDesign/SubjectDesign_ACE9001.cfg % or (alternative syntax): % #design.runs 1 2 3 4 % #design.files % /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_sessionDesign/ACE9001_SessionDesignA.cfg % /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_sessionDesign/ACE9001_SessionDesignB.cfg % /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_sessionDesign/ACE9001_SessionDesignC.cfg % /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_sessionDesign/ACE9001_SessionDesignD.cfg
fl('PREPROC',...) runs preprocessing steps Configuration (.cfg) file format e.g. %% EXAMPLE .CFG FILE DEFINING SOURCE DATA FILES AND MODEL INFORMATION %% see "help fl_process" for details %% #functionals /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/functionals/ACE9001_run00_61.nii /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/functionals/ACE9001_run01_63.nii /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/functionals/ACE9001_run02_65.nii /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/functionals/ACE9001_run03_67.nii #RT 2 Field values (follow fieldname) #structurals /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/mprage/ACE9001_run00_09.nii #design /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_subjectDesign/SubjectDesign_ACE9001.cfg % or (alternative syntax): % #design.runs 1 2 3 4 % #design.files % /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_sessionDesign/ACE9001_SessionDesignA.cfg % /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_sessionDesign/ACE9001_SessionDesignB.cfg % /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_sessionDesign/ACE9001_SessionDesignC.cfg % /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_sessionDesign/ACE9001_SessionDesignD.cfg
fl('PREPROC',...) runs preprocessing steps pipeline_info defines preprocessing pipeline information e.g. % EXAMPLE .CFG FILE DEFINING PREPROCESSING PIPELINE % see "help fl" for details % #steps functional_realign functional_center functional_art functional_segment&normalize_direct functional_smooth functional_smooth structural_center structural_segment&normalize #fwhm 4 6.9282 See example file /project/busplab/software/fl/example_preprocfile.cfg See list of current preprocessing pipelines in /project/busplab/software/fl/misc See help fl for additional details
fl('MODEL',...) runs first-level analysis steps design_info defines first-level model information e.g. %% DEFAULT .CFG FILE DEFINING FIRST-LEVEL MODEL OPTIONS %% see "help fl" for details %% #model_name Speech #contrasts Speech-Baseline Speech 1 Baseline -1 Baseline-Speech Baseline 1 Speech -1 #model_basis hrf+deriv #model_covariates motion art #model_serial AR(1) #hpf 128 #smoothinglevel 1 See example file /project/busplab/software/fl/example_modelfile.cfg See help fl for additional details
fl('MODEL',...) runs first-level analysis steps session_info defines run/session level experiment information e.g. %% EXAMPLE .CFG FILE DEFINING CONDITION TIMING INFORMATION %% see "help fl" for details %% #units secs #onsets 0.00 1 3.00 2 7.00 4 10.00 3 14.00 2 17.00 1 21.00 3 24.00 4 #names Speech_Same Speech_Diff Baseline_Same Baseline_Diff #durations 3 3 3 3 See example file /project/busplab/software/fl/example_sessionfile.cfg Session info can also be imported from a SPM.mat file (and BIDS json file in development) See help fl for additional details
fl('MODEL',...) runs first-level analysis steps subject_info defines subject-specific information (location of functional&anatomical files, TR, ) e.g. %% EXAMPLE .CFG FILE DEFINING SOURCE DATA FILES AND MODEL INFORMATION %% see "help fl_process" for details %% #functionals /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/functionals/ACE9001_run00_61.nii /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/functionals/ACE9001_run01_63.nii /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/functionals/ACE9001_run02_65.nii /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/functionals/ACE9001_run03_67.nii #RT 2 #structurals /projectnb/busplab/Experiments/ACE/ACE_reorg/Raw_data/nifti/ACE9001/mprage/ACE9001_run00_09.nii #design /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_subjectDesign/SubjectDesign_ACE9001.cfg % or (alternative syntax): % #design.runs 1 2 3 4 % #design.files % /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_sessionDesign/ACE9001_SessionDesignA.cfg % /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_sessionDesign/ACE9001_SessionDesignB.cfg % /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_sessionDesign/ACE9001_SessionDesignC.cfg % /projectnb/busplab/Experiments/ACE/ACE_reorg/scripts/ACE_sessionDesign/ACE9001_SessionDesignD.cfg Note: try to keep all information that is subject-specific in a single file Info used by PREPROC saludos Info used by MODEL
Summary Create configuration files containing all relevant info about your experiment SubjectInfoData.cfg (one per subject) point to functional/anatomical files; session design files SessionInfo.cfg (one per different session/run) condition names, onsets/durations PreprocInfo.cfg Preprocessing steps & details ModelInfo.cfg Model name, contrasts of interest Run FL scripts to import/preprocess/analyze your data fl PREPROC fl MODEL fl QACREATE fl QAPLOT
Remember to add FL to your current Matlab path Matlab command: addpath /project/busplab/software/fl Run FL scripts to import/preprocess/analyze your data fl PREPROC fl MODEL fl QACREATE fl QAPLOT
Import / preprocess data fl('PREPROC',...) runs preprocessing steps [,'subject_id'],id : subject IDs = folder names where data will be stored [,'subject_info',files] : subject data information files (one .cfg file per subject; e.g. {'/data/subject1.cfg','/data/subject2.cfg',...}) [,'subject_info',filter] : alternatively, path to subject data information files (e.g. '/data/subject*.cfg') [,'pipeline_info',file] : path to additional preprocessing pipeline information file, if any (e.g. 'example_preprocfile.cfg') [,'overwrite',flag] folders : [1/0] set to true to overwrite existing subject-id folders, or set to false to skip already-existing subject-id [,'parallel',flag] : [1/0] set to true to run using cluster parallelization resources, or set to false to run locally (default: 1) [,'root_folder',folder] default fl data folder) : output folder (where subject-ID folder names will be created/stored; if not specified root_folder will be the Matlab command: fl PREPROC ExperimentCode/SubjectID subject_info SubjectInfoFile.cfg pipeline_info PipelineInfoFile.cfg Subject data will be imported and preprocessed. The details of the raw subject data (e.g. functional/anatomical files) are in SubjectInfoFile.cfg, and the details of the preprocessing pipeline (e.g. preprocessing steps) are in PipelineInfoFile.cfg note: typically SubjectInfoFile.cfg contains subject-specific information (one file per subject), and PipelinInfoFile.cfg contains experiment-specific information (one file per analysis/experiment)
fl('PREPROC',...) runs preprocessing steps Import / preprocess data fl('PREPROC',...) runs preprocessing steps [,'subject_id'],id : subject IDs = folder names where data will be stored [,'subject_info',files] : subject data information files (one .cfg file per subject; e.g. {'/data/subject1.cfg','/data/subject2.cfg',...}) [,'subject_info',filter] : alternatively, path to subject data information files (e.g. '/data/subject*.cfg') [,'pipeline_info',file] : path to additional preprocessing pipeline information file, if any (e.g. 'example_preprocfile.cfg') [,'overwrite',flag] folders : [1/0] set to true to overwrite existing subject-id folders, or set to false to skip already-existing subject-id [,'parallel',flag] : [1/0] set to true to run using cluster parallelization resources, or set to false to run locally (default: 1) [,'root_folder',folder] default fl data folder) : output folder (where subject-ID folder names will be created/stored; if not specified root_folder will be the Example: Matlab command: fl PREPROC example ... subject_info /project/busplab/software/fl/example_datafile_subjectinfo.cfg ... pipeline_info /project/busplab/software/fl/example_preprocfile.cfg subject data will be stored in /projectnb/busplab/FLDATA/example/data/BIDS When preprocessing pipeline is submitted to the cluster (by default) use conn_jobmanager report to check the status of your jobs
fl('PREPROC',...) runs preprocessing steps subject_id defines where the data will be stored e.g. Matlab command: fl PREPROC ACE/C01 subject data will be stored in /projectnb/busplab/FLDATA/Aud/C01 Matlab command: fl PREPROC /mydata/C01 subject data will be stored in /mydata/C01 Matlab command: fl PREPROC C01 root_folder /mydata/ACE subject data will be stored in /mydata/ACE/C01 (by default root_folder points to /project/busplab/software/fl/DATA, a soft link to projectnb/busplab/FLDATA folder)
fl('PREPROC',...) runs preprocessing steps subject_id defines where the data will be stored Additional uses (import/preprocess multiple subjects in a single call): Matlab command: fl PREPROC subject_info /data/DataSubject*.cfg (matching several files /data/DataSubject1.cfg /data/DataSubject2.cfg, ) will import subject_id from filenames (DataSubject1, DataSubject2, ) Matlab command: fl PREPROC /ACE/C%02d subject_info /data/DataSubject*.cfg will import numeric portion of filenames only (ACE/C01, ACE/C02, ) Matlab command: fl( PREPROC ,subject_id, subject_info , subject_info, ) Use functional form of fl calls for more complex entries (e.g. subject_id may be a cell array containing explicit list of all subject_id s that we want to preprocess)
Model estimation fl('MODEL',...) runs first-level analysis steps [,'subject_id'],id : subject IDs = folder names where data is being stored [,'subject_info',files] : subject data information files (one .cfg file per subject; e.g. {'/data/subject1.cfg','/data/subject2.cfg',...}) [,'subject_info',filter] : alternatively, path to subject data information files (e.g. '/data/subject*.cfg') [,'design_info',file] : path to additional first-level design information file, if any (e.g. 'example_modelfile.cfg') [,'overwrite',flag] : [1/0] set to true to overwrite existing subject-id folders, or set to false to skip already-existing subject-id folders Matlab command: fl MODEL ExperimentCode/SubjectID subject_info SubjectInfoFile.cfg design_info DesignInfoFile.cfg Subject data will be analyzed using the experiment design info (e.g. condition onsets/durations) specified in SubjectInfoFile.cfg, and the model estimation options (e.g. contrasts of interest) specified in PipelineInfoFile.cfg note: typically SubjectInfoFile.cfg contains subject-specific information (one file per subject), and DesignInfoFile.cfg contains experiment-specific information (one file per analysis/experiment)
fl('MODEL',...) runs first-level analysis steps Model estimation fl('MODEL',...) runs first-level analysis steps [,'subject_id'],id : subject IDs = folder names where data is being stored [,'subject_info',files] : subject data information files (one .cfg file per subject; e.g. {'/data/subject1.cfg','/data/subject2.cfg',...}) [,'subject_info',filter] : alternatively, path to subject data information files (e.g. '/data/subject*.cfg') [,'design_info',file] : path to additional first-level design information file, if any (e.g. 'example_modelfile.cfg') [,'overwrite',flag] : [1/0] set to true to overwrite existing subject-id folders, or set to false to skip already-existing subject-id folders Example: Matlab command: fl MODEL example subject_info /project/busplab/software/fl/example_datafile_subjectinfo.cfg design_info /project/busplab/software/fl/example_modelfile.cfg subject results will be stored in /projectnb/busplab/FLDATA/example/results/firstlevel/Speech
Quality Assurance fl( QACREATE',...) creates QA plots [,'subject_id'],id : subject IDs = folder names where data is being stored [,'qa_plist',plots] : list of QA plots to create (see "help conn_qaplots" for additional details) Example: Matlab command: fl QACREATE example QA plots will be stored in /projectnb/busplab/FLDATA/example/results/qa Matlab command: fl ALL ExperimentCode/SubjectID subject_info SubjectInfoFile.cfg pipeline_info /project/busplab/software/fl/example_preprocfile.cfg design_info DesignInfoFile.cfg runs PREPROC, MODEL, and QACREATE sequentially
Quality Assurance fl( QAPLOT',...) displays QA plots [,'subject_id'],id : subject IDs = folder names where data is being stored Example: Matlab command: fl QAPLOT example fl QAPLOT ACE note: additional functionality for selective grouping of QA plots in development
Summary Create configuration files containing all relevant info about your experiment SubjectInfoData.cfg (one per subject) point to functional/anatomical files; session design files SessionInfo.cfg (one per different session/run) condition names, onsets/durations PreprocInfo.cfg Preprocessing steps & details ModelInfo.cfg Model name, contrasts of interest Run FL to import/preprocess/analyze your data fl PREPROC fl MODEL fl QACREATE fl QAPLOT