FreeSurfer 能完成对高分辨率的 MRI 图像进行分割、配准及三维重建,其处理过程主要包含去头骨、B1 偏差场校正、体数据配准、灰白质分割、面数据配准等。FreeSurfer 可以方便地处理大脑 MRI 图像,并生成高精度的灰、白质分割面和灰质、脑脊液分割面,根据这两个表面可以计算任何位置的皮质厚度及其他面数据特征如皮质 外表面积、曲率、灰质体积等,这些参数可以映射到通过白质膨胀算法得到的大脑皮质表面上直观显示。另外,FreeSurfer 还具有特征的组间差异分析及结果的可视化功能。
基本指令说明:https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferCommands
recon -all 命令详解:https://surfer.nmr.mgh.harvard.edu/fswiki/ReconAllDevTable
https://www.jianshu.com/p/8e63d73ec842

USAGE: recon-allRequired Arguments:-subjid <subjid>-<process directive>Fully-Automated Directive:-all           : performs all stages of cortical reconstruction-autorecon-all : same as -allManual-Intervention Workflow Directives:-autorecon1    : process stages 1-5 (see below)  # no-use-gpu: about 10 min-autorecon2    : process stages 6-23after autorecon2, check white surfaces:a. if wm edit was required, then run -autorecon2-wmb. if control points added, then run -autorecon2-cpc. proceed to run -autorecon3-autorecon2-cp : process stages 12-23 (uses -f w/ mri_normalize, -keep w/ mri_seg)-autorecon2-wm : process stages 15-23-autorecon2-inflate1 : 6-18-autorecon2-perhemi : tess, sm1, inf1, q, fix, sm2, inf2, finalsurf, ribbon-autorecon3    : process stages 24-34if edits made to correct pial, then run -autorecon-pial-hemi ?h       : just do lh or rh (default is to do both)Autorecon Processing Stages (see -autorecon# flags above):1.  Motion Correction and Conform  # 运动校正和一致2.  NU (Non-Uniform intensity normalization)  # 非均匀强度归一化3.  Talairach transform computation  #  Talairach变换计算4.  Intensity Normalization 1  # 强度归一化5.  Skull Strip  # 颅骨去除   6.  EM Register (linear volumetric registration)  # EM寄存器(线性体积配准)7.  CA Intensity Normalization  # CA强度归一化8.  CA Non-linear Volumetric Registration  # CA非线性体积配准9.  Remove neck  # 去除颈部10. EM Register, with skull  # EM注册,带头骨11. CA Label (Aseg: Volumetric Labeling) and Statistics  # CA标签(Aseg:体积标签)和统计12. Intensity Normalization 2 (start here for control points) # 强度归一化2(从控制点开始)13. White matter segmentation  # 白质细分14. Edit WM With ASeg  # 使用ASeg编辑WM15. Fill (start here for wm edits)  # 填充(从这里开始编辑wm)16. Tessellation (begins per-hemisphere operations)  # 曲面细分(每半球操作开始)17. Smooth118. Inflate119. QSphere20. Automatic Topology Fixer  # 自动拓扑修复器21. White Surfs (start here for brain edits for pial surf)  # 白色Surfs(从这里开始用于脑部冲浪的大脑编辑)22. Smooth223. Inflate224. Spherical Mapping  # 球面映射25. Spherical Registration  # 球形配准26. Spherical Registration, Contralater hemisphere  # 球面配准,Contralater半球27. Map average curvature to subject  # 将平均曲率映射到主题28. Cortical Parcellation (Labeling)  # 皮质分割(标签)29. Cortical Parcellation Statistics  # 皮质分割统计30. Pial Surfs  # Pial Surfs31. WM/GM Contrast  # WM / GM对比32. Cortical Ribbon Mask  # 皮质功能掩膜33. Cortical Parcellation mapped to ASeg  # Cortical Parcellation映射到ASeg34  Brodmann and exvio EC labels  # Brodmann和exvio EC标签Step-wise DirectivesSee -help...

在 FreeSurfer 软件中,运行“recon -all”命令后,会在 surf 文件夹下生成 . white、. sphere、. inflated 等网格点文件。每一个文件里面都存储了大脑皮质表面网格点的三维坐标及相邻顶点构成的三角面片信息,需要注意的是 FreeSurfer 采用的是 RAS 坐标系,其意义为 R:right,X 轴正方向;A:anterior,Y 轴正方向;S:superior,Z 轴正方向。

FreeSurfer 也会在 surf 文件夹下生成基于曲面的形态特征数据,不同的特征采用不同的文件后缀名,如皮质厚度( . thickness )、雅可比度量(. jacobian. white)、脑沟( . sulc )、曲率(. curv)、外表面积(. area)、体积(. volume)等面数据文件,其坐标索引号与 Mesh 网格序号一致。

FreeSurfer 在图像处理过程中依据 Destrieux 分区法对脑区进行标签划分。该分区方法将大脑皮质表面划分为 75 个脑区,其分区结构主要为各脑回和脑沟,分区依据为曲率的大小,其脑回区域只包括脑膜表面的部分,而隐藏在下面的部分则被划分为脑沟区域。其分区文件为 label 文件夹下的 h.aparc.a2009s.annot 文件,该文件夹下还有对应的部分 Broadmann 分区文件(. label)。

过程中可以使用以下命令来调用recon-all函数来进行脑区分割。该命令使用的文件类型为 mgz, nii, nii.gz。当当前的文件格式为其它格式时,可使用命令mri_convert * *.nii来进行格式转换。

$> export SUBJECTS_DIR=<path to subject directory> # SUBJECTS_DIR变量为存储数据的目录
$> recon-all -i sample-001.nii.gz -s bert -all (creates a folder called bert in SUBJECTS_DIR)

该操作是十分耗时的,进行一例nii数据的脑区分割需要8小时左右,具体时间视配置有所改变。在完成分割之后,即可通过可视化软件如FreeView来进行结果查看。这里,我们的目标是使用python来获取各个脑区的Mask,首先,看一下各个脑区对应的索引,该数据保存在$FREESURFER_HOME/FreeSurferColorLUT.txt:

https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/AnatomicalROIV6.0#IndividualStatsfiles
以下,我们假设保存的文件路径为bert。则,皮层下体积统计信息保存在bert/stats/aseg.stats中。统计信息包括 Index(在统计信息中的序号),SegId(对应的脑区索引),NVoxels(分割的体素数量),StrutName(在LUT中的名字),Mean/StdDev/Min/Max/Range: ROI的强度统计

FreeSurfer使用了多种皮质层分割方法。使用Desikan/Killiany Atlas可分为35个脑区,数据保存在bert/label/*h.aparc.annot中。使用Destrieux Atlas时,可分割出58个脑区,保存在bert/label/*h.aparc.a2009s.annot文件中。两中方法分割的统计信息保存在bert/stats中如:h.aparc.stats和h.aparc.a2009s.stats。MRI数据分别保存为bert/mri/aparc.DKTatlas+aseg.mgz以及bert/mri/aparc.a2009s+aseg.mgz,除此之外还有一个bert/mri/aparc+aseg.mgz。
统计信息表现为下图,StructName表示结构名,NumVert表示结构中包含的顶点数,SurfArea表示表面积,GrayVol表示灰质体积,ThickAvg/ThickStd表示结构厚度的均值与标准差,MeanCurv表示平均曲率,GausCurv表示平均高斯曲率,FoldInd表示折叠指数,CurvInd表示曲率指数。

软件用例

https://blog.csdn.net/uinglin/article/details/79541063

Example 1: 将sample-001.mgz 转换成nifti格式。.
$> cp $FREESURFER_HOME/subjects/sample-001.mgz .
$> mri_convert sample-001.mgz sample-001.nii.gz

Example 2: .对nifti文件进行重新配置

$> export SUBJECTS_DIR=
$> recon-all -i sample-001.nii.gz -s bert -all (creates a folder called bert in SUBJECTS_DIR)
Example 3: 在预先存在的主题文件夹上执行全面重新配置

$> export SUBJECTS_DIR=
$> recon-all -s bert -all

Introduction to Freesurfer Output

https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/OutputData_freeview
https://blog.csdn.net/qq_28480795/article/details/105094883
本教程旨在介绍Freeview。有关此处未介绍的按钮或菜单选项的信息,您可以在FreeviewGuide wiki上找到。
主要内容

  1. 如何可视化和检查FreeSurfer数据。
  2. 在Freeview中可视化数据的命令。
  3. 可视化数据时要寻找什么,包括表面遵循灰质和白质边界,以及aseg.mgz精确遵循皮质下强度边界。
  4. 可以在3D中查看表面,例如软脑膜、白色和膨胀表面、脑沟和皮质图、厚度图和皮质分区。
  5. 练习4,导出gif文件。
    注意事项
    每次进入终端使用FreeSurfer的时候需要输入命令:
    source ~/.bashrc
    export SUBJECTS_DIR=$TUTORIAL_DATA/buckner_data/tutorial_subjs
    cd SUBJECTS_DIR
    查看图像
freeview -v \
good_output/mri/T1.mgz \
good_output/mri/wm.mgz \
good_output/mri/brainmask.mgz \
good_output/mri/aseg.mgz:colormap=lut:opacity=0.2 \
-f good_output/surf/lh.white:edgecolor=blue \
good_output/surf/lh.pial:edgecolor=red \
good_output/surf/rh.white:edgecolor=blue \
good_output/surf/rh.pial:edgecolor=red

3D

freeview -f  good_output/surf/lh.pial:annot=aparc.annot:name=pial_aparc:visible=0 \
good_output/surf/lh.pial:annot=aparc.a2009s.annot:name=pial_aparc_des:visible=0 \
good_output/surf/lh.inflated:overlay=lh.thickness:overlay_threshold=0.1,3::name=inflated_thickness:visible=0 \
good_output/surf/lh.inflated:visible=0 \
good_output/surf/lh.white:visible=0 \
good_output/surf/lh.pial \
--viewport 3d

Practice Working with Data

https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/Practice
主要内容

  1. 打开一套扫描DICOM
  2. 为T1加权扫描找到正确的输入dicom文件
  3. 将此输入dicom文件传递给FreeSurfer的recon all stream。
    Exercise 1:
    用dicom_challenge中的数据生成surfers,输出在dicom_challenge/practice_subject目录下。
    cd KaTeX parse error: Undefined control sequence: \ at position 31: …icom_challenge \̲ ̲cd dicoms \ dcm…TUTORIAL_DATA/dicom_challenge
    recon-all -all -i I50 -s practice_subject
    说明:export =前后不能有空格
    (不是特别明白-i I50的意思)
    -i stands for input. Here, you would specify one dicom file/slice in the T1-weighted scan series you collected (FreeSurfer will find the rest of the files in the DICOM series/ the rest of the slices automatically). Make sure you specify the full path to the file if it is not in the directory you are currently in. You could also specify nifti files as input. If you have more than one T1-weighted scan for a given subject, use additional -i flags for each one.

Surface Based Group Analysis

https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/GroupAnalysisV6.0
主要内容

  1. 创建设计矩阵或FSGD文件
  2. 创建一个对比文件
  3. 通过运行mris_preproc和mri_surf2surf来收集数据
  4. 使用mri_glmfit运行GLM分析
  5. 使用freeview可视化分析

Clusterwise Correction for Multiple Comparisons (Permutation)多重比较的聚类校正(排列)

https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/MultipleComparisonsV6.0Perm
主要内容

  1. 使用mri_glmfit运行分析以获得未校正的地图
  2. 使用mri_glmfit-sim运行置换模拟
  3. 正确的多重比较

Surface Group Analysis with Qdec (Qdec表面基团分析)

https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/MultipleComparisonsV6.0Perm
https://blog.csdn.net/qq_28480795/article/details/105972389#comments_17694183
主要内容

  1. 使用mri_glmfit运行分析以获得未校正的地图
  2. 使用mri_glmfit-sim运行置换模拟
  3. 正确的多重比较

Surface Group Analysis with Qdec

https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/QdecGroupAnalysisV6.0
https://blog.csdn.net/qq_28480795/article/details/105993670
主要内容,学习如何对基于组曲面的数据执行统计分析,包括:

  1. 群数据的预处理
  2. 构建受试者人口统计的qdec.table.dat文件
  3. 使用Qdec设计和执行您的分析
  4. 与Qdec显示器交互
  5. 创建感兴趣区域(ROI),以便进一步分析和最终检查数据
  1. 从自己的数据集中创建平均对象,则可以使用make_average_subject(https://surfer.nmr.mgh.harvard.edu/fswiki/make_average_subject)。
  2. 问题 “qdec.bin: error while loading shared libraries: libjpeg.so.62: cannot open shared object file: No such file or directory”
    解决方案:sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2 /usr/lib/libjpeg.so.62 没有用
    apt-get install libjpeg62
    3)问题
    Tcl_Init error: Can’t find a usable init.tcl in the following directories:
    /usr/pubsw/packages/tcltktixblt/current/lib/tcl8.4 /home/hsn/freesurfer/lib/tcl8.4 /home/hsn/lib/tcl8.4 /home/hsn/freesurfer/library /home/hsn/library /home/hsn/tcl8.4.6/library /home/tcl8.4.6/library /usr/pubsw/packages/tcltktixblt/current/lib/tcl8.4
    This probably means that Tcl wasn’t installed properly.
    Error initializing Tcl.
    解决:~~sudo apt install tcl~~没有用,可能因为安装的位置不在上面的文件夹中,
    init.tcl文件在/home/hsn/freesurfer/lib/tktools/tcl8.4
    将tcl8.4拷贝至以上位置中的其中之一即可。
    类似的,需要将tktools文件夹内的内容全部拷贝至/home/hsn/freesurfer/lib/

Anatomical ROI analysis 解剖ROI分析

https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/AnatomicalROIV6.0
https://blog.csdn.net/qq_28480795/article/details/106191285

重点:Relationship between segmentation, parcellation and LookUp Table (LUT)
the orig and aparc+aseg segmentation volume (aparc+aseg.mgz)
the cortical surface parcellation (aparc.annot)
the subcortical segmentation (aseg) and the cortical parcellation (aparc)
The statistical output from the subcortical segmentation, called aseg.stats, is a regular text file and will contain the volumes of specific structures.
The statistical output from the cortical parcellation, called lh.aparc.stats and rh.aparc.stats, is a regular text file and will contain the thickness of specific structures.

在FreeSurfer处理流中,通过recon-all脚本生成了一些统计输出文件。 它们保存在每个受试者的stats /子目录中,并为**皮层下分割subcortical segementation(aseg)皮层分区cortical parcellation(aparc)**生成。
皮层下分割的统计输出称为aseg.stats,是常规文本文件,将包含特定结构的体积。
皮层分区的统计输出,称为lh.aparc.stats和rh.aparc.stats,是常规文本文件,将包含特定结构的厚度。
关于以上文件的介绍:
https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/AnatomicalROIV6.0#IndividualStatsfiles

关于皮层分区cortical parcellation

https://surfer.nmr.mgh.harvard.edu/fswiki/CorticalParcellation
https://blog.csdn.net/qq_28480795/article/details/112388509

使用GPU加速

-use-gpu,例:

$ recon-all -i sample-001.nii.gz -s SkullStrip_FreeSurfer -autorecon1 -use-gpu

Freesurfer tutorial主要内容相关推荐

  1. FreeSurfer Tutorial Datasets训练数据配置

    1.下载数据 如下命令实现下载实验数据,大概8GB,并解压建立一个文件夹tutorial_data.最后清除下载包. curl https://surfer.nmr.mgh.harvard.edu/p ...

  2. 2022.5.25 FreeSurfer入门练习:Recon-all

    2022.5.25 FreeSurfer入门练习:Recon-all 参考资料:https://andysbrainbook.readthedocs.io/en/latest/FreeSurfer/F ...

  3. 音视频干货|深入Storyteller:实时协同Tutorial编辑器

    在刚刚结束的 RTE 2020 创新挑战赛中我提交了名为 Storyteller 的作品,其功能是一个"实时协同的交互式 tutorial 编辑器".在本文中我会深入 Storyt ...

  4. MMpose 教程中文翻译-tutorial 0:学习配置文件

    这是一个对mmpose docs的中文翻译,自己在阅读的时候整理的,后续会继续翻译tutorial的内容.欢饮大佬们提建议,我也只是个学习中的小菜鸡 以下是mmpose教程链接 教程 0:学习 配置文 ...

  5. Ubuntu14.04安装freesurfer

    第一步:下载freesurfer:从freesurfer的官方网站上下载:http://surfer.nmr.mgh.harvard.edu/fswiki/Download  ,此处下载的是frees ...

  6. 如何学习Python开源项目代码

    2019独角兽企业重金招聘Python工程师标准>>> 阅读Python开源项目代码主要有如下三个原因: 1. 在工作过程中遇到一些问题,Google和StackOverFlow等网 ...

  7. Tools - 一些代码阅读的方法

    1 - 初始能力 让阅读思路清晰连贯,保持在程序的流程架构和逻辑实现上,不被语法.编程技巧和业务流程等频繁地阻碍和打断. 语言基础:熟悉基础语法,常用的函数.库.编程技巧等: 了解设计模式.构建工具. ...

  8. Scrapy爬虫入门系列2 示例教程

    本来想爬下http://www.alexa.com/topsites/countries/CN 总排名的,但是收费了 只爬了50条数据: response.xpath('//div[@class=&q ...

  9. GIS基础软件及操作(十)

    原文 GIS基础软件及操作(十) 练习十.网络分析 (1) 加深对网络分析基本原理.方法的认识: (2) 熟练掌握ARCGIS下进行道路网络分析的技术方法: (3) 结合实际.掌握利用网络分析方法解决 ...

最新文章

  1. Prevent Crow's Feet
  2. 短网址有啥好处,用长网址不香吗?
  3. 三级pc技术_第十九周PC、笔电、数码周边新品汇总:AMD英特尔激战正酣
  4. 将整张网页存成png图片
  5. 6-MyBatis基础
  6. (二)使用预定义模型 QStringListModel例子
  7. 分布式锁的过期时间设置多长合适_科普:Redis 分布式锁进化史(解读 + 缺陷分析)...
  8. 24.Creating Customer Groups
  9. 反射机制——获取Class中的方法
  10. 谷歌离线地图TMS服务教程
  11. 《统计学》第八版贾俊平第十一章一元线性回归知识点总结及课后习题答案
  12. QT中关于信号与槽机制的实现原理
  13. 让闲置物品“换”出财富
  14. torch.bmm()验证
  15. matlab中columns怎么用,css columns属性怎么用
  16. PC流氓软件卸载神器Geek Uninstaller
  17. 电子商务行业物流现状分析
  18. 从头开始学习C++(C++Primer第五版)
  19. 开启Windows11休眠功能
  20. 2019年泰国旅游记

热门文章

  1. mysql入坑之路(4)阿里云RDS数据备份本地恢复
  2. 【Windows问题】:在IDE代码补全时解决与Windows下的ctrl+空格切换输入法快捷键冲突问题
  3. webStorm中搜狗无法输入英文
  4. Java 8 List 排序
  5. 对于 docker-machine 的理解以及在 docker-swarm 中使用 python 针对于 docker 的 SDK
  6. 当领导得学会骂下属的艺术
  7. 【题库】上海市学校心理咨询师-普通心理学-考点解析 13.4 人格理论
  8. 文本生成 计算机语言,自然语言处理 -- 文本生成概述
  9. 敏捷软件开发及devops思想
  10. 申请微信支付相关事宜