biac:fsl:guide
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
biac:fsl:guide [2012/12/12 17:45] – [Instructions] petty | biac:fsl:guide [2012/12/12 17:59] – [V. Setting up Second-Level Analyses] petty | ||
---|---|---|---|
Line 67: | Line 67: | ||
* Click on **FEAT FMRI Analysis**. A different GUI will pop up after a few seconds. You can close any excess GUIs that arise. | * Click on **FEAT FMRI Analysis**. A different GUI will pop up after a few seconds. You can close any excess GUIs that arise. | ||
- | ===== Batching File Conversion===== | ||
- | If you have several subjects to do, you can batch them by running the following scripts in Golgi: | ||
- | ===== Fixing problems with image orientation ===== | ||
- | For some reason FSL has a problem with the orientation in our image headers. I'm not really sure of the reason, but sometimes things get registered backwards (ie: V1 is treated as the frontal lobes). | ||
- | |||
- | You can copy the ORIENT.mat file from my data drive on golgi | ||
- | (/ | ||
- | - In Golgi >> cd / | ||
- | - < | ||
- | - Then replace the last line of your fsf files to point to the new ORIENT file: | ||
- | set fmri(init_standard) "/ | ||
- | To edit text files on UNIX, use xemacs or nedit: " | ||
====== II.Setting-up First-level Analyses with FEAT ====== | ====== II.Setting-up First-level Analyses with FEAT ====== | ||
Line 112: | 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 124: | 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 140: | Line 129: | ||
sed -e ' | sed -e ' | ||
-e ' | -e ' | ||
- | -e ' | ||
-e ' | -e ' | ||
done | done | ||
Line 147: | 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 154: | Line 141: | ||
- close fsl | - close fsl | ||
- You can stop the test analysis by typing **killall** into the golgi window. However, It may be preferable to let the test analysis run all the way through, so you can see if the results (especially registration) turned out OK or not. | - You can stop the test analysis by typing **killall** into the golgi window. However, It may be preferable to let the test analysis run all the way through, so you can see if the results (especially registration) turned out OK or not. | ||
- | - cd to your FSL directory | + | - change directory |
- | - open your template file with nedit: **nedit template.fsf &** | + | - open your template file with gedit: **gedit template.fsf &** |
- You will now have to go through the template file and find all of the places where there will be variations between subjects and between runs. Usually you will need to change most of the file names in the script. | - You will now have to go through the template file and find all of the places where there will be variations between subjects and between runs. Usually you will need to change most of the file names in the script. | ||
- when you find one of these places in the .fsf file, replace the filename or number with a word, as marker. | - when you find one of these places in the .fsf file, replace the filename or number with a word, as marker. | ||
Line 173: | Line 160: | ||
- now, remember those markers you set up in the template.fsf file? For each one of those, you will need to make a variable that will replace it. If the variable will change for each run, put it inside the loop. Otherwise put it outside. | - now, remember those markers you set up in the template.fsf file? For each one of those, you will need to make a variable that will replace it. If the variable will change for each run, put it inside the loop. Otherwise put it outside. | ||
- The line **echo $OUTPUT** in the example code prints out to the screen the output directory. | - The line **echo $OUTPUT** in the example code prints out to the screen the output directory. | ||
- | - the line starting with **/ | ||
- now that you've set up variables for each of the markers in the template.fsf file, you will need to put those variables into the file. The //sed command// helps with this. I'm not sure why it is in a loop, but you can ask chris petty if you're curious. | - now that you've set up variables for each of the markers in the template.fsf file, you will need to put those variables into the file. The //sed command// helps with this. I'm not sure why it is in a loop, but you can ask chris petty if you're curious. | ||
- so, start out by copying the inner loop. If you already copied it when you copied the outer loop, then don't copy it again. | - so, start out by copying the inner loop. If you already copied it when you copied the outer loop, then don't copy it again. | ||
Line 183: | 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 215: | 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 ======= | ======= VI.Remaining Questions & Problems ======= |
biac/fsl/guide.txt · Last modified: 2024/06/21 15:44 by 127.0.0.1