记录fmriprep对应的输出文件命名

参考资料:

fmrirep官网
FMRIPrep: a robust preprocessing pipeline for functional MRI(2018)
Standford简单教程
Andy‘s book


一、必备知识:fMRI在测量什么?

What does fMRI measure?(2015)

以下介绍内容来自本篇论文的翻译:

1."fMRI does not directly measure brain activity"
fMRI并不是直接的测量neural activity(与EEG等相比),而是测量神经活动所产生的间接结果。
在这里插入图片描述
原文链接

2.三个关键原则:
1)神经活动与局部血液供应中氧气相对浓度的变化系统相关;
2)含氧血相对于脱氧血具有不同的磁化率;
3) 含氧/脱氧血液比率的变化(血流动力学反应函数)可以通过测量血氧水平依赖性 (BOLD) 反应来用 fMRI 推断。

3."spatial resolution"
我们得到的图像是3D的,所以定义体积像素(volume)。在一些典型的扫描中,一个体素大约覆盖3mm^3的的组织,这个体积将包含约 630,000 个皮层神经元。然而,体素的确切大小仅定义了理论上的最大分辨率。在实践中,fMRI 的有效分辨率还取决于血流动力学响应的空间特异性,以及更实际的考虑因素,例如扫描期间的头部运动程度。这些额外的因素会增加大量的空间失真或模糊。虽然有很多限制,但还是有一些有优秀的分辨率方法。而fMRI provides a good compromise between precision and coverage。

4。fMRI 具有良好的空间分辨率(如上所述),但时间分辨率较差
血流动力学响应对测量的时间精度施加了基本限制。首先,峰值响应延迟了大约 4-6 秒。然而,这对于离线分析并不重要,因为我们可以简单地调整我们的记录来纠正这种滞后。真正的问题是响应会随着时间的推移而延长。Temporal smoothing使得很难确定活动的精确时刻。
在这里插入图片描述

5."too much data to make sense of"
1)动态的大脑功能理论:大脑活动本质上是非静止的——认知状态的连续性/稳定性不太可能依赖于静态活动状态,而是临时连接模式的快速变化。(Research Briefing: Dynamic population coding for flexible cognition
2)标准 fMRI 实验在一次扫描中生成数千个测量值。 这是 fMRI(大规模同时记录)的主要优势,但也带来了许多统计挑战。

6."too many free parameters"
It is important to define the analysis pipeline independently of your research question, rather than try them all and choose the one that gives you the ‘best’ result.

7.“…相关性,而不是因果关系”
人们经常指出功能磁共振成像只能提供相关证据。对于任何其他测量技术也可以这样说。仅仅因为某个大脑区域以特定的心理功能亮起,我们不能确定观察到的活动是否真的导致了心理事件(见这里)。只有介入干扰方法才能提供这样的因果证据,但这并不一定意味着因果方法更好。Neural recordings可以为大脑活动在正常行为期间如何展开提供非常丰富的见解。相反,causal methods允许您在没有特定区域的情况下测试系统的行为方式。因为大脑中可能存在冗余(能够执行相同功能的多个大脑区域),干扰方法很容易错过重要的贡献。此外,扰乱神经系统可能会产生难以控制的连锁反应,从而使积极影响复杂化。上述旨在提醒一种方法并不明显优于另一种方法。

8."…the spectre of reverse inference"
一种流行的推理形式:
在本研究中,当任务比较 A (task comparison A )出现时,大脑区域 Z 是活跃的。
在其他研究中,当认知过程 X 被假定参与时,大脑区域 Z 是活跃的。
因此,本研究中区域 Z 的活动通过任务比较 A 证明了认知过程 X 的参与。

这是一个“反向推理”,因为它从大脑激活的存在向后推理到特定认知功能的参与。反向推理不是演绎推理的有效依据,因为可能还有其他认知功能会激活大脑区域。然而,推理的一般形式可以提供有用的信息,特别是当特定大脑区域的功能相对特定且特别容易理解时。使用积累的知识来解释新发现对于理论构建是必要的。但是,由于结构和功能之间存在严格的一对一映射,因此最好从贝叶斯角度而不是逻辑推理来进行反向推理。
在这里插入图片描述
原文:putting big data to good use

二、fmriprep做了什么?

以下内容均摘自fmriprep简单介绍和实现
1)Brain mask and tissue segmentation以定位大脑及其组织类型。这意味着将大脑与其周围不必要的组织(脑膜)分开,并按组织类型将大脑分成几部分(组织分割)。
2)Normalizing the scans用作表面重建(surface reconstruction)的map参考(这本质上是我们正在使用的用于分析的大脑的“计算机化”表示),这结束了解剖预处理步骤(anatomical preprocessing)。空间归一化(Spatial normalization)使所有不同的大脑扫描相互映射:由于人类大脑不同,我们需要进行归一化以使位置一致。
3)functional part:coregistration — to align the anatomical and functional. This involves overlaying functional (referred to as BOLD) data over the structural.(配准 - 以对齐解剖和功能)
4)对功能图像进行校正:包括头部运动校正等。

tips:Nilearn
注意:here are several steps fmriprep left out. Some examples include cortex inflation or flattening which is mostly for better visualization since all the surface folding can be too much, especially if we want to look at the functional activity “inside”, i.e., behind all the folding. It also skipped slice timing correction, a trick to make all slices seem like they were done at the same time — a step potentially leading to interpolation errors.(fmriprep省略了几个步骤,fmriprep本身不进行任何校正操作,例如切片定时校正,平滑等;不过注意有两个例外)


具体来说:
(1)Preprocessing of structural MRI
首先通过使所有找到的 T1w 图像符合 RAS 方向和共同体素大小来构建平均图像,并且在多个图像的情况下,将它们平均到单个参考模板中(The anatomical sub-workflow begins by constructing an average image by conforming all found T1w images to RAS orientation and a common voxel size, and, in the case of multiple images, averages them into a single reference template (see Longitudinal processing)。使用 ANTs的 Nipype 实现对 T1w reference进行颅骨剥离。注意,公开共享的数据集可能包含预处理的解剖图像,尝试再次执行大脑提取通常会产生较差的结果,并可能导致 fMRIPrep 崩溃。 fMRIPrep 可以尝试使用启发式方法检测这些情况,通过 —skull-strip-t1w auto 明确请求。如果失败,并且已知头骨剥离,则可以使用 --skull-strip-t1w skip 跳过大脑提取。同样,如果图像没有剥去头骨但auto错误地确定它们是,可以使用 --skull-strip-t1w force 强制剥去头骨Brain extraction, brain 1)tissue segmentation and spatial normalization
brain extraction:ANTs
brain tissue segmentation:FSL
spatial normalization:ANTs’ antsRegistration
2)Cost function masking during spatial normalization
3)Longitudinal processing
4)Surface preprocessing
重建表面(3个步骤),不需要则使用:–fs-no-reconall
5)Refinement of the brain mask

(2)BOLD preprocessing
Head-motion estimation, Slice time correction, Susceptibility Distortion Correction (SDC),etc.

三、运行的输出文件命名

原链接
生成的文件结构:
logs文件记录boilerplate text。
在这里插入图片描述

在这里插入图片描述
1)anat(对应Anatomical derivatives放置路径)下的文件:
在这里插入图片描述2)Functional derivatives存储在 func/ 子文件夹中。所有派生词都包含 task-<task_label>(强制)和 run-<run_index>(可选),这些将用 [specifiers] 表示 :
在这里插入图片描述
实例:
在这里插入图片描述
另外,一些transforms文件(_xfm)也存储在func文件夹下:
在这里插入图片描述

1.命名规范

BIDS-Derivative dataset must fully comply with the BIDS-Raw spec unless explicitly extended, negated or contradicted in this document or one of the domain-specific extensions. In case of any apparent conflict between BIDS-Raw and BIDS-Derivatives, the latter always takes precedence.
Filenames that are permissible under BIDS-Raw have a privileged status. Any modification of BIDS-Raw files must use a modified filename that does not conflict with the BIDS-Raw filename. Further, any files created as part of a BIDS-Derivative dataset must not match a permissible filename of a valid BIDS-Raw dataset. Stated equivalently, if any filename in a BIDS-Derivative dataset has a name permissible under BIDS-Raw, then that file must be an identical copy of that file in the associated BIDS-Raw dataset
即对 BIDS-Raw 文件的任何修改都必须使用与 BIDS-Raw 文件名不冲突的修改文件名。

2.命名形式

form:

<source_keywords>[_keyword-<value>]_<suffix>.<ext>

1)source_keyword
When the derivatives chain involves outputs derived from a single BIDS-Raw input, source_keywords MUST be the entire filename from the BIDS-Raw input, including any optional components that were included in the BIDS-Raw filename, except that the suffix must always come at the end of the filename (and just before the extension). One exception to this rule is filename keywords that are no longer relevant (such as sub- in the case of group level derivatives). Depending on the nature of the derivative file, the suffix can either be the same as the original BIDS-Raw input if that suffix is still appropriate, or a new appropriate value selected from the controlled list.

When the derivatives output involves multiple BIDS-Raw inputs, source_keywords should preserve the elements in common between the input filenames in the process of creating a sensible source_keywords

2)_suffix
文件名以单个 _suffix 标记结尾,并且在文件名的其他地方不允许有其他 _suffix 标记。仅允许使用规定的后缀,也可以包含任意数量的可以由用户命名的key-value对,但不能使用未明确允许的键值对。
在这里插入图片描述

参考链接

3)_keyword-value
Unless specified otherwise, the value component of a _keyword-value pair is freeform and should be set appropriately by the user.

4)不禁止在不同 BIDS-Derivatives 目录中使用相同的文件名,尽管用户应该意识到这可能会产生潜在的歧义,并使用 sidecar JSON 文件来详细说明各个文件的细节. (Other than the privileged status of BIDS-Raw filenames, there is no prohibition against identical filenames in different BIDS-Derivatives directories, although users should be aware of the potential ambiguity this can create and use the sidecar JSON files to detail the specifics of individual files.)

5)当需要区分两个文件时,应该使用 _desc- 关键字值。这包括需要区分不同输入和不同输出的情况[例如,_desc-T1w 和 desc-T2w 以区分源自 T1w 和 T2w 图像的brain mask文件;或 _desc-sm4 和 _desc-sm8 以区分使用两种不同平滑级别生成的输出]

总结:如上所述,BIDS-Derivative 标准扩展了 BIDS-Raw 标准。 因此,文件的组织应尽可能符合 BIDS-Raw( unless explicitly contradicted by BIDS-Derivatives)。 任何subject-specific derivatives都应存放在每个主题的目录中; 如果生成了session-specific derivatives,则它们应存放在相应主题目录中的subject子目录下; 等等。
除了 BIDS-Raw 规范中定义的结构外,BIDS-Derivatives 规范提供了额外的灵活性,旨在解释不适合标准 BIDS-Raw 项目布局的derivatives。 特别是,管道可能会生成不严格属于任何单个参与者的derivatives。 要编写组级结果,可以使用derivatives/<pipeline_name>/ 下的 group/ 文件夹:

<dataset>/derivatives/<pipeline_name>/group/

3.Derived dataset and pipeline description

1)dataset_description.json(必须存在)的路径:
/derivatives/<pipeline_name>/dataset_description.json
dataset_description.json文件说明:
文件可以包含任意键值对,这些键值对对与理解目录结构和内容相关的metadata 进行编码。尽管没有严格控制的词汇,但强烈建议用户在可用时使用 Raw-BIDS 规范中定义的键。此外,BIDS-Derivatives 规范引入了许多其他必需或推荐的密钥:
在这里插入图片描述
在这里插入图片描述
2)每个derivative文件都有对应的一个json文件(如下图所示,as a sidecar or higher up in the hierarchy of the derived dataset)

在这里插入图片描述
3)Each derivative type defines their own set of fields, but all of them share the following (non-required) ones:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
4)datatypes
(1)Processed, coregistered and/or resampled volumes
在这里插入图片描述
在这里插入图片描述

The space keyword denotes the space of the file with a controlled vocabulary of values
空间标准化derivatives用space标签表示,例如 MNI152NLin2009cAsym(默认),而原始 T1w 空间中的derivatives省略了space关键字。可以通过安装python的TemplateFlow包,下载对应的模板。

python -m pip install -U templateflow
python -c "from templateflow.api import get; get(['MNI152NLin2009cAsym', 'MNI152NLin6Asym', 'OASIS30ANTs', 'MNIPediatricAsym', 'MNIInfant'])"

(2)Mask:A binary (1 - inside, 0 outside) mask in the space defined by (see Table targets/spaces). By default (i.e., if no transformation has taken place) the value of space should be set to “orig”.
在这里插入图片描述

在这里插入图片描述

(2)Mappings (transformation) between spaces
Transform-files are labeled with the from- and to- BIDS entities. An additional entity, mode-<mode_label>, indicates what kinds of objects the transform operates to
注:Acceptable mode_label values are image, points, surface and sphere.
a the transform file from-A_to-B_mode-points is completely equivalent to from-B_to-A_mode-image.
在这里插入图片描述
原始 T1w 采样和 FreeSurfer 用于表面重建的一致空间(fsnative)之间的仿射平移(和逆向)存储在 :
在这里插入图片描述

(3)Segmentation Metadata:dseg,probseg…
eg:来自freesurfer的Surfaces, segmentations and parcellations,he (aparc+)aseg segmentations are aligned to the subject’s T1w space and resampled to the BOLD grid, and the BOLD series are resampled to the mid-thickness surface mesh.
在这里插入图片描述

这里仅介绍三种,具体请查阅官方文档…
(4)提取到的confounding time series,位于/func文件夹下,对于使用 fMRIPrep 处理的每个 BOLD 处理,将生成一个随附的混淆文件。文件的每一行对应于在相应的 BOLD 时间序列中找到的一个时间点。在这里插入图片描述
最常用的混淆时间序列:
(1)估计的头部运动参数:trans_x、trans_y、trans_z、rot_x、rot_y、rot_z - 6 个刚体运动参数(3 个平移和 3 个旋转),相对于参考图像进行估计;
(2)global_signals:
csf - the average signal within anatomically-derived eroded CSF mask;
white_matter - the average signal within the anatomically-derived eroded WM masks;
global_signal - the average signal within the brain mask.

注意:
(1)不要将 ~_desc-confounds_timeseries.tsv 表的所有列都包含在您的设计矩阵或去噪过程中。首先过滤表格,以仅包含要从 fMRI 信号中删除的confounds(或其组成部分)。混杂变量的选择可能取决于您要执行的分析,并且可能并不简单,因为不存在黄金标准程序。有关各种去噪策略及其性能的详细描述请参阅:

An evaluation of the efficacy, reliability, and sensitivity of motion correction strategies for resting-state functional MRI

(2)若预处理过程中若使用切片校正,默认情况下,fMRIPrep 中的切片定时校正参考中间切片,这导致体积起始时间偏移 0.5 TR(重复时间)。例如,假设 TR 为 2s,则原始起始点 0、2 和 4s 将分别移动到 1、3 和 5s。如果您确实执行了切片时序校正,则必须检查后续分析(例如,一般线性建模)是否考虑了正确的起始偏移。例如,指定一级模型时,应在软件包或一级模型函数中相应设置参数(例如,选择中间切片作为参考)。

参考这个博客:Slice timing correction in fMRIprep and linear modeling

在这里插入图片描述

总结

对文档说明进行一个简单的梳理归纳,后续可自行查阅。刚接触,所以搞得相对细了一点。一起学习交流呀!

  • 1
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值