FSL FEAT: error in execution

I am running my analysis in FSL FEAT (preprocessing-fmriprep, spatial smooth-FSLmaths) and have all aspects input accordingly for the event files (not sure what details I should include here to be helpful). I go to run the analysis and get an error in “preprocess stage 2” according to the log file.

Below is the extent of the report and the error:

Feat main script


/bin/cp /tmp/feat_BJJ3Z0.fsf design.fsf

/usr/local/fsl/bin/feat_model design

mkdir .files;cp /usr/local/fsl/doc/fsl.css .files;cp -r /usr/local/fsl/doc/images .files/images

/usr/local/fsl/bin/fsl_sub -T 10 -l logs -N feat0_init   /usr/local/fsl/bin/feat /home/afton/Documents/dcm2bids_P10_test/derivatives/fsl_first-level.feat/design.fsf -D /home/afton/Documents/dcm2bids_P10_test/derivatives/fsl_first-level.feat -I 1 -init
9014

/usr/local/fsl/bin/fsl_sub -T 0 -l logs -N feat2_pre -j 9014  /usr/local/fsl/bin/feat /home/afton/Documents/dcm2bids_P10_test/derivatives/fsl_first-level.feat/design.fsf -D /home/afton/Documents/dcm2bids_P10_test/derivatives/fsl_first-level.feat -I 1 -prestats
9462

/usr/local/fsl/bin/fsl_sub -T 65 -l logs -N feat3_film -j 9462  /usr/local/fsl/bin/feat /home/afton/Documents/dcm2bids_P10_test/derivatives/fsl_first-level.feat/design.fsf -D /home/afton/Documents/dcm2bids_P10_test/derivatives/fsl_first-level.feat -I 1 -stats
child process exited abnormally
    while executing
"if { [ catch {

for { set argindex 1 } { $argindex < $argc } { incr argindex 1 } {
    switch -- [ lindex $argv $argindex ] {

	-I {
	    incr arginde..."
    (file "/usr/local/fsl/bin/feat" line 312)

FATAL ERROR ENCOUNTERED:
COMMAND:
/usr/local/fsl/bin/fsl_sub -T 65 -l logs -N feat3_film -j 9462  /usr/local/fsl/bin/feat /home/afton/Documents/dcm2bids_P10_test/derivatives/fsl_first-level.feat/design.fsf -D /home/afton/Documents/dcm2bids_P10_test/derivatives/fsl_first-level.feat -I 1 -stats
ERROR MESSAGE:
child process exited abnormally
END OF ERROR MESSAGE

I do not find that the error message is very specific and have not found others with the same error. Would anyone have any ideas? Happy to include more information where it would be helpful!

Hi @aftonnelson,

Can you provide the details of your .fsf file?

Hi @dlevitas,

Sure thing! The file is attached. It was too large to copy/paste. contents of fsf file.txt (42.3 KB)

Just to clarify, this data you’re feeding into FSL FEAT has been preprocessed using fMRIPrep, and then you spatially smoothed the data at 6mm? If so, it appears that you’re needlessly re-running certain preprocessing steps in FSL FEAT, for example, MCFLIRT motion correction in FEAT, when fmriprep has already performed motion correction on the BOLD data.

It looks like you’ve been running this via fsl_sub; however, have you tried using the FSL FEAT GUI on this subject? Even though it’s point-and-click, it allows you to carefully set up your analyses, and then it can save a .fsf file for you that you could use as a template for the rest of your dataset. Alternatively, you can also load in a .fsf file to the FEAT GUI. Running a single subject through the GUI can help assure that things are running smoothly.

FSL FEAT error messages can be a bit crytic, and unfortunately I can’t be sure what’s causing the error. However, given the .fsf file you’ve provided, some things appear odd, for example the MCFLIRT motion correction on your already motion-corrected fmriprep preprocessed data. Another example, you’ve specified no convolution, even though you’ve provided timing files for each of your EVs:

# Convolution (EV 2)
# 0 : None
# 1 : Gaussian
# 2 : Gamma
# 3 : Double-Gamma HRF
# 4 : Gamma basis functions
# 5 : Sine basis functions
# 6 : FIR basis functions
# 8 : Alternate Double-Gamma
set fmri(convolve2) 0

@dlevitas Ah okay, this is very helpful to get a sense of. Yes, I have preprocessed the data with fmriprep and smoothed at 6mm with a mask. I am not sure why it would run the preprocessing again?

When I opened the FSL FEAT interface, I selected ‘Statistics’ (not ‘Full Analysis’). I went to ‘Misc’ and estimated the number of total volumes from the data (and omitted some initial volumes per my own TR calculation). Under ‘Data’, I only loaded in the smoothed .niix file of a single participant. Under ‘Stats’, I went to full model setup and entered in 4 different EVs and their corresponding contrasts. Initially, this gave me an error until I deselected add temporal derivative. From there, I just hit ‘Go’.

As far as I can tell, I did not enter preprocessing or registration information.

I am trying to do what you mentioned: to establish the protocol/template to use for all analysis.

I think selecting “Statistics” is only appropriate when you have a FEAT direcectory to feed in. For a first-level analysis, I believe you need to go through the “Full-Analysis”. Here are some tips for the different FEAT sections you van do when using fmrirep-preprocessed data in FSL FEAT (Full-Analysis):

Misc
These default values can be left as is unless you feel strongly about changing them

Data
Upload your fmriprep-preprocessed and spatially smoothed data. Your output_directory could be something like ‘/home/afton/Documents/dcm2bids_P10_test/derivatives/fsl_first-level/sub-10_run-1’. Then select the number of volumes you wish to delete.

Pre-stats
Since fmriprep has already preprocessed your data, you’ll want to unselect these steps (i.e. make sure the boxes aren’t yellow). That way, FEAT won’t repeat these steps. For Temporal filtering, I would suggest unselecting Highpass as well. The reason is because fmriprep generates these values in each func BOLD run corresponding confounds file (the colums are cosine00, cosine 01, cosine02, cosine03). There’s a recent paper that suggests that preprocessing and analysis in a odular fashion can potentially reintroduce noise; better to have the highpass filtering in your design matrix for nuisance regression.

Registration
Leave the values as they are, but change the 12 DOF to 6 DOF.

Stats

Don’t add the motion parameters from FSL FEAT; fmriprep already provides these for you. Select “Add additional confounds EVs” and then load a .txt file that contains a subset of columns from each functional BOLD confounds files (e.g. motion parameters, those highpass cosine columns that fmriprep provides, etc).

Go to “Full Model setup” and for each EV, provide a name, select the basic shape (I believe you specififed custom (3 file format). This means that for each condition of each subject run, you’ll need to provide a .txt file with three columns. The first column is the onset time, the second column is the duration, and the third column is the parameter modulation (which is just a value of 1). You’ll then need to select a convolution; Double-Gamma HRF is commonly used, but I don’t know what you experimental paradigm is, so something else may be more appropriate. Once you’ve done all this you can click on the “view design” button to see what your design matrix looks like, to ensure that things look proper. Once all your EVs are set up, go to Contrasts & F-tests and set things up as you want.

Post-stats
Default values can be left as is, unless you feel strongly about changing then.

Only you’ve done all this, you should click the Save button to save this .fsf file; you can then use it as a reference for the other runs and subjects. Andy Jahn has a good tutorial on how you can use this .fsf file to automate the FEAT process.

If your first-level FSL FEAT works, you’ll want/need to go over this tutorial by @Jeanette_Mumford regarding how to avoid FEAT’s registration, which is already done by fmriprep. You essentially trick FEAT into performming registration on an identity matrix.

Hope this helps.

1 Like

Yes, this is most helpful!!! Thank you for the run-down and the resources!

I am now encountering some strange warning about my EVs being too close in linear combination with the others. This results in the following model:

However, I did not have this issue before when checking the model. My event files (4) look fine to me, so I am unsure why this matrix is so large.

On a related note:
I was also wondering if you knew whether fmriprep performs temporal filtering?
This would influence whether or not I include this in the GLM of FEAT.

It appears that you added a ton of additional confounds EVs to your design matrix. Just to reiterate, you’ll only want to select a subset of confounds from the fmriprep generated confound .tsv files. fmriprep generates so many confounds so that users have options for different analyses for post-processing. However, this means that you don’t want to select all of them for nuisance regression, etc.

Yes, on the right side of your screenshot, in the “General Linear Model” GUI, at the bottom there’s the option to select “Apply temporal filtering”. You can also add a temporal derivative.

To the first point:

Ah, okay! This makes sense. Before I had not included them, so of course the error did not occur.

To the second point:
I see that it is possible. But I was wondering if this is something fmriprep already does when preprocessing?

No, fmriprep only performs minimal preprocessing, which is to say, preprocessing steps that the neuroimaging community unanimously agrees on.

That being said, fmriprep provides some handy confounds in the confounds.tsv file(s) that you could potentially use. From the fmriprep documentation:

Parameter expansion of basic confounds. The standard six-motion parameters may not account for all the variance related to head-motion. [Friston1996] and [Satterthwaite2013] proposed an expansion of the six fundamental head-motion parameters. To make this technique more accessible, fMRIPrep automatically calculates motion parameter expansion [Satterthwaite2013], providing time series corresponding to the first temporal derivatives of the six base motion parameters, together with their quadratic terms, resulting in the total 24 head motion parameters (six base motion parameters + six temporal derivatives of six motion parameters + 12 quadratic terms of six motion parameters and their six temporal derivatives). Additionally, fMRIPrep returns temporal derivatives and quadratic terms for the three global signals (csf, white_matter and global_signal) to enable applying the 36-parameter denoising strategy proposed by [Satterthwaite2013].

Derivatives and quadratic terms are stored under column names with suffixes: _derivative1 and powers _power2. These are calculated for head-motion estimates (trans_ and rot_) and global signals (white_matter, csf, and global_signal).

Hi,

I have a question regarding this answer.

I was following the steps in FSL but in “Stats”, when I select “Add additional confounds EVs”, what type of .txt file do I add here (scanner to T1 mode image or T1w to scanner mode image or is it a different file from the func folder from fMRIPrep) if I used fMRIPrep for preprocessing?

I would really appreciate if you could provide me some advice regarding this question.

Thank you in advance for your help.

Best regards,

Rubina Chandnani

Hi @Rubina,

For this you’d want to load a .txt file that contains a subset of columns from each functional BOLD confounds files (e.g. motion parameters, the highpass cosine columns that fmriprep provides, etc). The confounds files are provided from fmriprep processing, but be sure to not upload ALL the confounds; you’ll only want the .txt file to contain a fraction of them. Which ones you choose will depend on the type of analysis you’re planning to conduct.

Hi @dlevitas,

Thank you for your response.

I decided not to upload the .txt file to keep things simple, however, I have a question related to the first-level and higher-level analysis.

I ran a first-level and higher-level analysis following the steps in this link: Mumford Brain Stats — FEAT registration workaround since I preprocessed the data using fMRIPrep.

However, after doing the higher-level analysis, the reg summaries were missing. I receive a warning message that reads:

“WARNING:: Inconsistent orientations for individual images when attempting to merge.
Merge will use voxel-based orientation which is probably incorrect - PLEASE CHECK!”

I’ve also attached the log file to describe the errors I’m receiving. Higher-level analysis FSL log report.txt (35.4 KB)

I would really appreciate your guidance and/or advice on how to fix these errors.

Many thanks and best regards,

Rubina Chandnani

Unfortunately, I’m not well-versed with FSL warning & error messages and I haven’t come across this specific message before. My suggestion would be to reach out to the FSL team on the FSL message board.

I would also recommend ensuring that that FEAT registration workaround was done correctly (the end of the video specifies how you can check your work).

Hi Rubina,

I have also used the FEAT registration work around. I did not encounter this issue at the higher-level analysis and her steps seemed to work accordingly. I second dlevitas in making sure the work around was correctly executed after the first-level.

Thank you for your response, @aftonnelson

I just read this post FSL scripting: error in execution of FSL FEAT - #8 by dlevitas and realised that I have to run the first-level analysis and feed the fMRIPrep data in the second-level analysis. Where do I save the .fsf file since I have 3 runs?

Thank you in advance for your help.

Best,

Rubina

If you’re using the FSL FEAT graphical user interface then there is a “Save” button at the bottom that will create an .fsf file based on the information you’ve provided. I’d recommend not saving until once you’ve finished entering information for the first-level analysis.

An issue with FEAT is automation, given that during the first level you must perform FEAT on each run, and the fsf files can be a bit complicated. You can check out this tutorial by Andy Jahn that focuses on how to solve this issue. If instead you’d prefer an easier (but longer) solution, you would perform first-level FEAT on each subject’s run.

I performed the first-level analysis with FSL creating 3 .fsf files for each run. After running the higher-level analysis, I checked and the images between stats/cope#.nii.gz and reg_standard/stats/cope#.nii.gz are not the same.

I followed the steps using “Mumford Brain Stats-FEAT registration workaround” and used the exact codes, however, I can’t see what I missed here.

Is there something I should’ve done that I’m not seeing?

When you pre-processed your data with fMRIPrep, which --output-spaces did you use, and did you specify --use-aroma by any chance?