This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
biac:fsl:guide [2012/12/12 17:52] petty [making the batch script] |
biac:fsl:guide [2012/12/12 18:01] petty |
||
---|---|---|---|
Line 100: | Line 100: | ||
====== III. Writing a batch script for FSL ====== | ====== III. Writing a batch script for FSL ====== | ||
If you have a lot of subjects or many runs to do the same analysis to, you may want to run a batch script to avoid tediously running the the rather slow FSL GUI. Batch scripts should be written on golgi using nedit. | If you have a lot of subjects or many runs to do the same analysis to, you may want to run a batch script to avoid tediously running the the rather slow FSL GUI. Batch scripts should be written on golgi using nedit. | ||
- | This script will run FEAT analysis, but requires 1)converted anat and func files and 2) a template. See [[biac: | + | This script will run FEAT analysis, but requires 1)converted anat and func files and 2) a template. See [[biac: |
Here's a sample **batchFSL** script: | Here's a sample **batchFSL** script: | ||
+ | |||
<code bash># | <code bash># | ||
#for each subject you will have to modify this script for the number of runs and | #for each subject you will have to modify this script for the number of runs and | ||
Line 112: | Line 114: | ||
#change this part | #change this part | ||
SUBJ=$1 | SUBJ=$1 | ||
- | FSLDATADIR=~/ | + | EXPDIR=`findexp |
- | ANATFILE=${FSLDATADIR}/ | + | FSLDATADIR=${EXPDIR}/Data/FSL/${SUBJ} |
+ | ANATFILE=${FSLDATADIR}/ | ||
######### | ######### | ||
#makes the orient file | #makes the orient file | ||
- | / | ||
- | ORIENT=$FSLDATADIR/ | ||
for run in 01 02 03 04; do | for run in 01 02 03 04; do | ||
| | ||
Line 128: | Line 129: | ||
sed -e ' | sed -e ' | ||
-e ' | -e ' | ||
- | -e ' | ||
-e ' | -e ' | ||
done | done | ||
Line 135: | Line 135: | ||
done | done | ||
</ | </ | ||
- | |||
===== making a template .fsf file ===== | ===== making a template .fsf file ===== | ||
when making a batch file, you need to have a template file that has the outline for your FEAT analysis. | when making a batch file, you need to have a template file that has the outline for your FEAT analysis. | ||
Line 170: | Line 169: | ||
- | ====== IV.Incorporating MELODIC analyses ====== | ||
- | See also the [[http:// | ||
- | |||
- | The MELODIC option runs the ICA (Independent Component Analysis) tool in FSL. This allows identification of structured noise in the fMRI data, which can be selectively removed to improve the FEAT results. | ||
- | * If you get an error " | ||
- | < | ||
- | . / | ||
- | You can add these commands to the profile using **nedit ~/ | ||
- | * Run Feat pre-stats processing only, by selecting Pre-stats from the top-right menu. Make sure you turn on MELODIC ICA in the Pre-stats section of the FEAT GUI. | ||
- | * Open the MELODIC report (feat_output_directory.feat/ | ||
- | * In a terminal, run the MELODIC denoising, using the commands: | ||
- | < | ||
- | melodic -i filtered_func_data --mix=../ | ||
- | where you should replace the comma-separated list of component numbers with the list that you previously recorded when viewing the MELODIC report. **This only takes 1-2 minutes.** | ||
- | * Now reopen the FEAT GUI and set the top-right menu to **Stats + Post-stats**. | ||
- | * Set the input data to be **feat_output_directory.feat/ | ||
====== V. Setting up Second-Level Analyses ====== | ====== V. Setting up Second-Level Analyses ====== | ||
- | * Bring up a Golgi window in F-Secure SSH. | ||
- | * **cd / | ||
* Type **fsl**. Click **FEAT**. | * Type **fsl**. Click **FEAT**. | ||
* Change the top left pull-down menu to **Higher-level analysis**. | * Change the top left pull-down menu to **Higher-level analysis**. | ||
Line 202: | Line 183: | ||
Your new analyses will be saved in a new directory called **across_runs.gfeat**. | Your new analyses will be saved in a new directory called **across_runs.gfeat**. | ||
- | There is a good description of concepts behind higher-level analyses on the [[http://www.fmrib.ox.ac.uk/ | + | There is a good description of concepts behind higher-level analyses on the [[http://fsl.fmrib.ox.ac.uk/ |
- | + | ||
- | + | ||
- | ======= VI.Remaining Questions & Problems ======= | + | |
- | + | ||
- | Intermittent crashes on golgi, often suggesting an "out of memory" | + | |
- | + | ||
- | + | ||
- | + | ||
- | ===== Registration ===== | + | |
- | + | ||
- | Registration is very poor for many of the spiral images | + | |
- | * Should we correct for maximum image intensity in some way? | + | |
- | * Do we use ORIENT files? Registration seems dubious. | + | |
- | + | ||
- | It may be the case that if there is less than 120mm in any direction, then it will pop up the " | + | |
- | + | ||
- | ===== Using ORIENT Files ===== | + | |
- | + | ||
- | The ORIENT file created by Syam Gyadde seems to give better registration results for data acquired with both spiral and EPI sequences. The file is a .mat file located in / | + | |
- | + | ||
- | == ORIENT in template.fsf == | + | |
- | The last section of the template.fsf should read as follows: | + | |
- | + | ||
- | < | + | |
- | # Alternative example_func image (not derived from input 4D dataset) | + | |
- | set fmri(alternative_example_func) "" | + | |
- | + | ||
- | # Delete GLM residuals? | + | |
- | set fmri(cleanup_residuals_yn) 1 | + | |
- | + | ||
- | # Initial structural space registration initialisation transform | + | |
- | set fmri(init_initial_highres) "" | + | |
- | + | ||
- | # Structural space registration initialisation transform | + | |
- | set fmri(init_highres) "" | + | |
- | + | ||
- | # Standard space registration initialisation transform | + | |
- | set fmri(init_standard) " | + | |
- | + | ||
- | == ORIENT in batchFSL == | + | |
- | + | ||
- | * Before the **for** loop in the batch script begins, paste the following line: | + | |
- | + | ||
- | < | + | |
- | / | + | |
- | ORIENT=$FSLDATADIR/ | + | |
- | + | ||
- | * You will also need to define the variable name **ORIENT** in your sed list: | + | |
- | < | + | |
- | + | ||
- | + | ||
- | ===== MELODIC ICA ===== | + | |
- | + | ||
- | + | ||
- | ===== Second-level Analyses ===== | + | |
- | + | ||
- | ====== Troubleshooting ====== | ||
- | === Registration problems: === | ||
- | * Problem: the data is being registered as a large, stretched-out brain, going way beyond the bounds of a normal brain | ||
- | * Solution: check the .bxh header files for your original functional data. The scanner has recently been putting out functional images with voxel sizes for anatomical images. | ||
- | * Problem: the brain is being flipped so that the frontal lobe is near the cerebellum | ||
- | * Solution: run a BET brain extraction on the anatomical data. See step 5 in the [[biac: | ||
- | === FEAT errors === | ||
- | * Problem: while running a batch script, all of the FEAT windows pop up at once even though the script is supposed to run them sequencially | ||
- | * Solution: open the script using nedit and find the line that starts with **feat** followed by some input files. | ||
- | * Problem: when running a batch script, the FEAT Watcher says that the number of volumes is 0 | ||
- | * Solution: your script is pointing to a file that doesn' | ||
- | * Problem: when running a batch script, the FEAT Watcher says that the number of volumes is incorrect (not 0, see above) | ||
- | * Solution: the batch script is most likely using a template file that assumes that all of your runs have the same number of time points. | ||
- | * Problem: the run stopped, saying the problem was possibly golgi ran out of memory | ||
- | * Solution: |