1 Introduction
1.1Overview - FMRIB's ICA-based Xnoiseifier
FIX attempts to auto-classify ICA components into "good" vs "bad" components, so that the bad components can be removed from the 4D FMRI data. FIX is intended to be run on single-session MELODIC ICA output. See example raw data movies showing the (potentially huge) effect of FIX cleanup. This beta-version of FIX is a set of R, MATLAB and shell scripts and hence requires you to have various other software than just FSL - and for now is not bundled as part of FSL. If you use FIX, please cite these papers:
1. G. Salimi-Khorshidi, G. Douaud, C.F. Beckmann, M.F. Glasser, L. Griffanti S.M. Smith. Automatic denoising of functional MRI data: Combining independent component analysis and hierarchical fusion of classifiers. NeuroImage, 90:449-68, 2014
2. L. Griffanti, G. Salimi-Khorshidi, C.F. Beckmann, E.J. Auerbach, G. Douaud, C.E. Sexton, E. Zsoldos, K. Ebmeier, N. Filippini, C.E. Mackay, S. Moeller, J.G. Xu, E. Yacoub, G. Baselli, K. Ugurbil, K.L. Miller, and S.M. Smith. ICA-based artefact removal and accelerated fMRI acquisition for improved resting state network imaging. NeuroImage, 95:232-47, 2014
The latest version (1.06) can now be run without MATLAB, using either the supplied precompiled-matlab binaries, or with Octave. The other change from v1.05 is a change in the top-level meta-classifier, which gives a tiny average improvement in classification accuracy. There is no need to rerun feature generation from v1.05 for use in v1.06, but the old trained-weights files cannot be used with v1.06 (and any custom trained-weights files will need regenerating).
For FIX to work well, it is very important that it is run using good "training data". While a few example trained-weights files are supplied with FIX, for major studies we would strongly recommend training FIX on your own study data (see details in the User Guide section). You can find example training-input data, including our hand-labellings, here (note that you do not need this example training-input data in order to run FIX; you just need the download linked in the User Guide - Downloading and Installing FIX section) , which includes several trained-weights files).
2 User Guide
2.1 下载和安装FIX
2.2 运行FIX
2.2.1 简单用法,假定你已经有训练数据
/usr/local/fix/fix <mel.ica>
/usr/local/fix/training_files/Standard.RData 20
您需要提供由MELODIC或FEAT GUI创建的完整的“一级first-level”(单session)输出目录(<mel.ica>
),并运行完整的配准(registration),包括使用结构像。如果使用FEAT,你需要在Prestats中打开ICA。对于单个被试ICA,一般应该使用MELODIC的自动维数估计(这将创建子文件夹< meli.ICA >/filtered_func_data.ica
)。20
是好组件与坏组件的阈值;敏感值一般在5-20之间。但是,如果对您来说非常重要的是几乎没有好的组件被删除,因此您希望在数据中留下大量的坏组件,那么就使用一个较低的阈值(例如,在1-5范围内)。强烈建议你看看ICA组件检查至少有几个科目的分类-查看名为fix4melview_Standard_thr20.txt
之类的文件最后一行列出了组件视为噪音要删除(索引从1而非0开始计数)。当运行修复如图所示上面,您将得到4D预处理FMRI数据的清洁版本:filtered_func_data_clean.nii.gz
。
如果您有一个计算集群,您可以通过在它前面加上类似fsl_sub -q long ...
的东西来将整个命令发送到集群。但是,如果您使用fix来训练分类器并运行留一测试(参见2.2.3),我们建议您在本地运行fix,如果您的本地计算机能够向集群提交作业,因为它将为您完成这一任务,并行化LOO,并大大提高它的速度)。
2.2.2 每个步骤单独运行时的用法
上面的命令等价于下面的3步:
(1)提取特征(用于后续训练 和/或 分类)
/usr/local/fix/fix -f <mel.ica>
(2)使用特定训练集 来 分类 ICA成分(<thresh> is in the range 0-100, typically 5-20))
/usr/local/fix/fix -c <mel.ica> <training.RData> <thresh>
(3)使用 .txt 文件中列出的伪影,应用清洗到 Melodic目录里面的数据。
使用.txt文件中列出的工件,对外围Feat/Melodic目录中的数据应用清理。这个文本文件可以是上面步骤的输出,也可以手动创建,以防您想手动删除人工组件。在第二种情况下,确保txt文件只包含一行(或至少应该是最后一行),其中包含坏组件的列表,格式(例如):[1,4,99,…注意,方括号和逗号的使用是必需的。另外,确保在最后有一个空行(例如,在写完列表后按回车)。从1开始计数,而不是0。
/usr/local/fix/fix -a <mel.ica/fix4melview_TRAIN_thr.txt> [-m [-h <highpass>]] [-A]
- m: 可选的,也是用于清洗 motion 混淆(24个回归参数),头动混淆的高通滤波又以下控制:
- if -h 被忽略,fix会查询是否存在一个
design.fsf
文件来找到高通截断。如果-h被忽略且不存在design.fsf
文件,将不执行头动混淆的过滤;
if 设置了-h <highpass>
,则;
-h -1 不对头动混淆执行过滤,-h 0执行线性去漂移。
-h <highpass> 的<highpass>为正值时,应用 <highpass>的高通apply highpass with <highpass> being full-width (2sigma) in seconds.
- if -h 被忽略,fix会查询是否存在一个
- -A:应用aggressive(全变异)清洗,而不是默认的less-aggressive(单一变异)清洗。
2.2.3 训练数据集
FIX需要从多个数据集进行训练,这些数据集已经手工将ICA组件划分为“好”和“坏”。到目前为止,我们已经手工训练了一些不同类型的数据,FIX提供了这些数据的训练权重文件。如果您想自己训练FIX(通常是推荐的),为了更好地针对您拥有的数据类型优化它,您将需要自己进行手动分类(至少10个被试)。或者,你也可以使用训练过的 由FIX提供的*.RData
文件之一。
目前提供了几个训练好的权重文件:
Standard.RData
- for use on more "standard" FMRI datasets / analyses; e.g., TR=3s, Resolution=3.5x3.5x3.5mm, Session=6mins, default FEAT preprocessing (including default spatial smoothing).这个时FEAT预处理默认的(包括了空间平滑)HCP_hp2000.RData
for use on "minimally-preprocessed" 3T HCP-like datasets, e.g., TR=0.7s, Resolution=2x2x2mm, Session=15mins, no spatial smoothing, minimal (2000s FWHM) highpass temporal filtering.HCP7T_hp2000.RData
for use on "minimally-preprocessed" 7T HCP-like datasets, e.g., TR=1.0s, Resolution=1.6x1.6x1.6mm, Session=15mins, no spatial smoothing, minimal (2000s FWHM) highpass temporal filtering.WhII_MB6.RData
derived from the Whitehall imaging study, using multiband x6 EPI acceleration: TR=1.3s, Resolution=2x2x2mm, Session=10mins, no spatial smoothing, 100s FWHM highpass temporal filtering.WhII_Standard.RData
derived from more traditional early parallel scanning in the Whitehall imaging study, using no EPI acceleration: TR=3s, Resolution=3x3x3mm, Session=10mins, no spatial smoothing, 100s FWHM highpass temporal filtering.UKBiobank.RData
derived from fairly HCP-like scanning in the UK Biobank imaging study: 40 subjects, TR=0.735s, Resolution=2.4x2.4x2.4mm, Session=6mins, no spatial smoothing, 100s FWHM highpass temporal filtering.
你可以遭到训练输入数据的示例,包括我们的手工标签,, here (注意如果为了运行FIX你不需要这个训练数据的示例; 你需要的只是已经包含在FIX路径中的训练好的权重trained-file文件).
2.2.3.2 如何创建一个新的trained-weights 文件
暂时pass
2.2.4 必要的输入文件——详细信息
如果你没有执行全部的基于GUI的MELODIC/FEAT 分析,你可能需要,在一个目录中包括以下文件:
filtered_func_data.nii.gz preprocessed 4D data
filtered_func_data.ica melodic (command-line program) full output directory
mc/prefiltered_func_data_mcf.par motion parameters created by mcflirt (in mc subdirectory)
mask.nii.gz valid mask relating to the 4D data
mean_func.nii.gz temporal mean of 4D data
reg/example_func.nii.gz example image from 4D data
reg/highres.nii.gz brain-extracted structural
reg/highres2example_func.mat FLIRT transform from structural to functional space
design.fsf FEAT/MELODIC setup file; if present, this controls the
default temporal filtering of motion parameters
3 FAQ
3.1 When I run FIX, I obtain the following output: “No valid labelling file specified”. What does it mean?
FIX doesn’t find the classification file with the list of components to be removed, so the error could be either in the features extraction or in the classification. To see which is the problem have a look at the following log files:
<subject.ica>/fix/logMatlab.txt
(this should show errors in Matlab part, i.e. features extraction)<subject.ica>/.fix.log
<subject.ica>/.fix_2b_predict.log
(those are log file in general for the whole routine) You’ll probably find errors related to Matlab or R, so you might need to check your settings.sh file following the setup instructions described in the FIX README file
3.2 How do I choose the best training dataset (among the existing ones) and/or threshold for my data?
FIX is more likely to work better with the training dataset that is most similar to your data, both in terms of acquisition parameters (TR and resolution) and preprocessing steps applied. Regarding the threshold to use, you can start with the “default” 20 and increase or decrease it according to FIX performance (i.e. visual check of the components' classification contained in the file fix4melview_TRAIN_thr.txt). For example, if it is very important to you that almost no good components are removed, and hence you would prefer to leave in the data a larger number of bad components, then use a low threshold. If you want to remove more noise, use a higher threshold.
3.3 What is the difference between fsl_regfilt and FIX?
FIX is an automated equivalent of fsl_regfilt (they both perform non-aggressive (unique variance) cleanup by default), so you don’t need to run both:
fsl_regfilt
: manual classification of unwanted components + run fsl_regfilt —> cleaned data 不想要的成分的手工分类 + 运行fsl_regfilt
—> 清洗数据FIX
: automated classification artefactual components and regression of their contribution out of the data —> cleaned data 自动分类伪影成分 和 把它们的影响从数据中回归掉
To check that FIX is removing the artifactual components correctly (i.e. it is doing what you would do running fsl_regfilt) you can check the classification done by FIX in the fix4melview….txt file and adjust the training dataset and threshold you are using as appropriate.
要检查FIX是否正确地移除了伪影成分(即它是否做了你想用fsl_regfilt做的)你可以检查 在fix4melview….txt
文件中的FIX的分类并调整训练数据集,调整你用作appropriate的阈值。
3.4 Can I use FIX to clean task fMRI data?
Yes, although you will probably need to create a study-specific training dataset
3.5 When I run FIX to create a new training file (-t), the output folder is created, but no .RData is produced at the end, with no explicit error message. What does it mean?
Check the content of the folllowing hidden files within the output directory created:
.fixlist --> should contain the list of subjects included in the training dataset (to check if they've been all loaded/recognised properly)
.Rlog1 --> contains errors from R about the generation of the .RData file
Also, make sure that the .txt files (hand_labels_noise.txt) are in the correct format: the last line should contain the list of the components only, within square brackets and comma separated, and there should be an empty line at the end (i.e. hit return after writing the list).