Modifying FEAT, MELODIC ICA, FIX - McIntosh-Lab/tvb-ukbb GitHub Wiki
Our pipeline calls FEAT and FIX in its rfMRI processing. FEAT performs Independent Component Analysis (ICA) by calling MELODIC. ICs generated by MELODIC are classified by FIX as signal or noise using user-provided training files or manual classification files. FIX denoises 4D fMRI images by eliminating noise ICs.
Users may choose to customize MELODIC analysis and FIX classification.
By default, MELODIC performs automatic estimation to generate a number of ICs. If there are too many ICs being generated for your dataset (e.g. high dimensional data), you may decide to explicitly limit the number of ICs that MELODIC will generate. You may do so by appending these lines to the end of bb_functional_pipeline/bb_prepare_rfMRI, before the footer:
echo "set fmri(dim_yn) 0" >> $1/fMRI/rfMRI_$2.fsf
echo "set fmri(dim) <num_ICs>" >> $1/fMRI/rfMRI_$2.fsf
Replace <num_ICs> with your desired number of ICs.
You may choose to perform manual classification of ICs, providing a hand-labelled text file to FIX instead of a training file.
In order to do so, first run your subject through MELODIC, commenting out all steps of the pipeline past that point:
- Comment out subpipes from bb_pipeline_tools/bb_pipeline.py: diffusion, IDP generation, and QC
- Comment out jobs from bb_functional_pipeline/bb_pipeline_func.py: FIX, FC generation, rfMRI cleanup, and any tfMRI processing
- Run your subject(s). The pipeline will stop after FEAT (MELODIC).
Perform manual classification and generate a text file with your labels in your ICA directory. See FIX User Guide for details. You will then need to edit the following in bb_functional_pipeline/bb_fix:
${FSL_FIXDIR}/fix . ${FSL_FIXDIR}/training_files/${TRAINING_FILE} 20 -m -h 100
to
${FSL_FIXDIR}/fix -a <path>/<to>/<your_manual_labelled_IC_file>.txt -m -h 100
For generalizability and code-automation it is recommended that you have your manual labelled IC file placed in the corresponding ICA directory and <path>/<to>/<your_manual_labelled_IC_file>.txt
can just be the filename of the manual labelled IC file.
In order to resume the pipeline and finish processing your subjects:
- restore the code commented out in steps 1 and 2 above.
- Comment out jobs from bb_functional_pipeline/bb_pipeline_func.py: structural postprocessing, gradecho fieldmap processing, rfMRI prep, and FEAT.
- Comment out subpipes from bb_pipeline_tools/bb_pipeline.py: structural
- Run your subject(s).