Li‘s 核磁共振影像数据处理-20-FSL数学工具fslmaths

2023-05-16

讲解视频内容请移步Bilibili:
https://space.bilibili.com/542601735
入群讨论请加v hochzeitstorte
请注明“核磁共振学习”
公众号:美好事物中转站

FSLeyes/FSLView

交互式显示工具。
FSLeyes界面
FSLeyes界面

fslmaths常用命令

Usage: fslmaths [-dt ] <first_input> [operations and inputs] [-odt ]

Datatype information:
-dt sets the datatype used internally for calculations (default float for all except double images)
-odt sets the output datatype ( default is float )
Possible datatypes are: char short int float double input
“input” will set the datatype to that of the original image

Binary operations:
(some inputs can be either an image or a number)
-add: add following input to current image
-sub: subtract following input from current image
-mul: multiply current image by following input
-div: divide current image by following input
-rem: modulus remainder - divide current image by following input and take remainder
-mas: use (following image>0) to mask current image
-thr: use following number to threshold current image (zero anything below the number)
-thrp: use following percentage (0-100) of ROBUST RANGE to threshold current image (zero anything below the number)
-thrP: use following percentage (0-100) of ROBUST RANGE of non-zero voxels and threshold below
-uthr: use following number to upper-threshold current image (zero anything above the number)
-uthrp: use following percentage (0-100) of ROBUST RANGE to upper-threshold current image (zero anything above the number)
-uthrP: use following percentage (0-100) of ROBUST RANGE of non-zero voxels and threshold above
-max: take maximum of following input and current image
-min: take minimum of following input and current image
-seed: seed random number generator with following number
-restart: replace the current image with input for future processing operations
-save: save the current working image to the input filename

Basic unary operations:
-exp: exponential
-log: natural logarithm
-sin: sine function
-cos: cosine function
-tan: tangent function
-asin: arc sine function
-acos: arc cosine function
-atan: arc tangent function
-sqr: square
-sqrt: square root
-recip: reciprocal (1/current image)
-abs: absolute value
-bin: use (current image>0) to binarise
-binv: binarise and invert (binarisation and logical inversion)
-fillh: fill holes in a binary mask (holes are internal - i.e. do not touch the edge of the FOV)
-fillh26: fill holes using 26 connectivity
-index: replace each nonzero voxel with a unique (subject to wrapping) index number
-grid : add a 3D grid of intensity with grid spacing
-edge: edge strength
-tfce : enhance with TFCE, e.g. -tfce 2 0.5 6 (maybe change 6 to 26 for skeletons)
-tfceS <tfce_thresh>: show support area for voxel (X,Y,Z)
-nan: replace NaNs (improper numbers) with 0
-nanm: make NaN (improper number) mask with 1 for NaN voxels, 0 otherwise
-rand: add uniform noise (range 0:1)
-randn: add Gaussian noise (mean=0 sigma=1)
-inm : (-i i ip.c) intensity normalisation (per 3D volume mean)
-ing : (-I i ip.c) intensity normalisation, global 4D mean)
-range: set the output calmin/max to full data range

Matrix operations:
-tensor_decomp: convert a 4D (6-timepoint )tensor image into L1,2,3,FA,MD,MO,V1,2,3 (remaining image in pipeline is FA)

Kernel operations (set BEFORE filtering operation if desired):
-kernel 3D: 3x3x3 box centered on target voxel (set as default kernel)
-kernel 2D: 3x3x1 box centered on target voxel
-kernel box : all voxels in a cube of width mm centered on target voxel
-kernel boxv : all voxels in a cube of width voxels centered on target voxel, CAUTION: size should be an odd number
-kernel boxv3 : all voxels in a cuboid of dimensions X x Y x Z centered on target voxel, CAUTION: size should be an odd number
-kernel gauss : gaussian kernel (sigma in mm, not voxels)
-kernel sphere : all voxels in a sphere of radius mm centered on target voxel
-kernel file : use external file as kernel

Spatial Filtering operations: N.B. all options apart from -s use the default kernel or that previously specified by -kernel
-dilM: Mean Dilation of non-zero voxels
-dilD: Modal Dilation of non-zero voxels
-dilF: Maximum filtering of all voxels
-dilall: Apply -dilM repeatedly until the entire FOV is covered
-ero: Erode by zeroing non-zero voxels when zero voxels found in kernel
-eroF: Minimum filtering of all voxels
-fmedian: Median Filtering
-fmean: Mean filtering, kernel weighted (conventionally used with gauss kernel)
-fmeanu: Mean filtering, kernel weighted, un-normalised (gives edge effects)
-s : create a gauss kernel of sigma mm and perform mean filtering
-subsamp2: downsamples image by a factor of 2 (keeping new voxels centred on old)
-subsamp2offc: downsamples image by a factor of 2 (non-centred)

Dimensionality reduction operations:
(the “T” can be replaced by X, Y or Z to collapse across a different dimension)
-Tmean: mean across time
-Tstd: standard deviation across time
-Tmax: max across time
-Tmaxn: time index of max across time
-Tmin: min across time
-Tmedian: median across time
-Tperc : nth percentile (0-100) of FULL RANGE across time
-Tar1: temporal AR(1) coefficient (use -odt float and probably demean first)

Basic statistical operations:
-pval: Nonparametric uncorrected P-value, assuming timepoints are the permutations; first timepoint is actual (unpermuted) stats image
-pval0: Same as -pval, but treat zeros as missing data
-cpval: Same as -pval, but gives FWE corrected P-values
-ztop: Convert Z-stat to (uncorrected) P
-ptoz: Convert (uncorrected) P to Z
-rank: Convert data to ranks (over T dim)
-ranknorm: Transform to Normal dist via ranks

Multi-argument operations:
-roi : zero outside roi (using voxel coordinates). Inputting -1 for a size will set it to the full image extent for that dimension.
-bptf <hp_sigma> <lp_sigma>: (-t in ip.c) Bandpass temporal filtering; nonlinear highpass and Gaussian linear lowpass (with sigmas in volumes, not seconds); set either sigma<0 to skip that filter
-roc [4Dnoiseonly] : take (normally binary) truth and test current image in ROC analysis against truth. is usually 0.05 and is limit of Area-under-ROC measure FP axis. is a text file of the ROC curve (triplets of values: FP TP threshold). If the truth image contains negative voxels these get excluded from all calculations. If is positive then the [4Dnoiseonly] option needs to be set, and the FP rate is determined from this noise-only data, and is set to be the fraction of timepoints where any FP (anywhere) is seen, as found in the noise-only 4d-dataset. This is then controlling the FWE rate. If is negative the FP rate is calculated from the zero-value parts of the image, this time averaging voxelwise FP rate over all timepoints. In both cases the TP rate is the average fraction of truth=positive voxels correctly found.

Combining 4D and 3D images:
If you apply a Binary operation (one that takes the current image and a new image together), when one is 3D and the other is 4D,
the 3D image is cloned temporally to match the temporal dimensions of the 4D image.

e.g. fslmaths inputVolume -add inputVolume2 output_volume
fslmaths inputVolume -add 2.5 output_volume
fslmaths inputVolume -add 2.5 -mul inputVolume2 output_volume

fslmaths 4D_inputVolume -Tmean -mul -1 -add 4D_inputVolume demeaned_4D_inputVolume

今日代码

从atlas中抠出标号为2的脑区
fslmaths HarvardOxford-sub-maxprob-thr50-2mm.nii.gz -thr 2 -uthr 2 roi_2.nii.gz
将抠出的脑区标签调整为1
fslmaths roi_2.nii.gz -bin roi_2_bin.nii.gz
从大脑中抠出标号为2的脑区
fslmaths MNI152_T1_2mm_brain.nii.gz -mul roi_2_bin.nii.gz MNI_T1_2mm_roi_2.nii.gz
膨胀操作
fslmaths MNI_T1_2mm_roi_2.nii.gz -kernel boxv 3 -dilM MNI_T1_2mm_roi_2_dilM.nii.gz

课后作业

从大脑影像中抠出atlas中标号为3和4的大脑,并做腐蚀(erode)操作。
练习用影像及atlas下载:
公众号“美好事物中转站”回复关键词:mni
美好事物中转站
美好事物中转站

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Li‘s 核磁共振影像数据处理-20-FSL数学工具fslmaths 的相关文章

  • 生产者消费者代码实现(JAVA)

    代码 import lombok extern slf4j Slf4j import java util LinkedList final class Message 单条消息 private int id private String m
  • 手误删除服务器tomcat下的bin目录,./start.sh无效

    关于LINUX权限 bash startup sh Permission denied 在执行 startup sh 或者 shutdown sh的时候 xff0c 爆出了Permission denied xff0c 其实很简单 xff0
  • C++ 进程间通信

    一 xff0c C 43 43 常用进程间通信 管道 Pipe xff1a 管道可用于具有亲缘关系进程间的通信 xff0c 允许一个进程和另一个与它有共同祖先的进程之间进行通信 命名管道 named pipe xff1a 命名管道克服了管道
  • 【Android7.1.2源码解析系列】Android ADB概览 ---system/core/adb/OVERVIEW.txt

    ADB实施笔记 I 总体概览 xff1a 安卓调试桥 ADB 被用来 xff1a 保持一条指向于所有安卓设备以及连接向或者运行于所给的开发主机的仿真机 实现多个适用于客户端 命令行用户或者像DDMS那样的帮助程序 的控制命令 比如说 34
  • 内存泄漏 定位方法

    目录 内存概念 物理内存 虚拟内存 内存泄漏 定位方法和手段 1 MemInFo MemTotal MemFree MemAvailable Cached 2 vmalloc info 3 Kmemleak 算法原理 使用方法 参考文献与链
  • 关于环形缓冲区的用法和理解

    通信中 xff0c 经常会遇到数据交互的问题 为了保证数据的高效处理和解析 xff0c 通常会有 缓冲区的说法 接下来谈谈常用的环形缓冲区的特点和使用方法 xff1a 说到环形缓冲区 xff0c 相信大家都不会陌生 xff0c 这里就不贴图
  • 电脑安装系统时提示“找不到硬盘”如何解决

    电脑安装系统的方法有很多众 xff0c 比较常见的是用PE来安装的 xff0c 当然也可以用U盘安装 安装过程中无法识别到硬盘那是很正常的事 xff0c 相信大部分用户都遇到过 xff0c 该如何解决 xff1f 不要担心 xff0c 本教
  • springMVC零配置之上下文配置

    记得刚参加工作的时候 xff0c 搭建springMVC框架还是需要手动配置web xml文件 xff0c 现在已经被渐渐淘汰了 xff0c 在项目中几乎看不到有这种配置了 xff0c 取而代之的是springMVC的零配置 xff0c 原
  • 记一次美团校招内推笔试经历

    2019年4月23日星期二晚上七点 这天刚好项目上生产我负责留守做远程技术支持 留下的还有个重要的原因就是今晚我有一个美团的笔试 七点笔试准时开始 信心满满打开网页地址 美团用的是赛码网来做的笔试题库 xff0c 再次之前收到了邀请码输入进

随机推荐

  • Android 使用 Kotlin 重写 Gradle 文件(Kotlin Gradle DSL)

    概述 众所周知 xff0c 我们在 Android Studio 是使用 Gradle 来编译的 xff0c Gradle 是一种基于 Groovy 语言的构建工具 xff0c 我们平时看到的 build gradle 中的语法结构其实就是
  • Can't open /dev/sda3 exclusively. Mounted filesystem?解决办法

    报错 root 64 hadoop101 moduels pvcreate dev sda3 Can t open dev sda3 exclusively Mounted filesystem 处理方法 umount home ext 上
  • Execution failed for task ‘:app:checkDebugDuplicateClasses‘.崩溃了崩溃了

    FAILURE Build completed with 2 failures 1 Task failed with an exception What went wrong Execution failed for task 39 app
  • @RunWith报错/SpringJUnit4ClassRunner报错或无法使用

    项目场景 xff1a 问题描述 xff1a 64 RunWith SpringJUnit4ClassRunner class 报错 第一步 xff1a 首先确保你的pom下有这两个依赖的jar包坐标 注意junit版本要4 12或者以上 我
  • java集合的扩容机制

    目录 ArrayList 和Vector扩容机制总结 xff1a LinkedList没有扩容机制 xff1a HashSet和HashMap扩容机制总结 xff1a Hashtable扩容机制 xff1a 小结 xff1a HashTab
  • virtualbox 开机启动虚拟机方案(无CMD窗口)

    通过bat与vbs组合使用 xff0c 让virtualbox在开机自启动时没有cmd窗口 xff0c 核心是start b指令与ws Run 34 E virtualbox virtualbox boot bat 34 0命令 1 进入
  • idea使用教程

    目录 一 创建Java工程二 设置显示常见的视图三 常用配置 xff08 重点 xff09 四 IDEA常用快捷键五 创建Java Web Project或Module六 IDEA配置本地 Tomcat七 IDEA关联数据库 xff1a 一
  • Mybatis的增删改查和resultMap的使用

    目录 MyBatis的增删改查jdbcType的使用和作用 xff1a 获取自增主键的值 xff1a 自增主键的作用和使用方法 xff1a MyBatis的接口方法的参数如何与映射文件进行关联 xff1a 1 单个参数 xff1a 2 多个
  • Maven的安装与配置(详细版)

    目录 一 安装本地Maven xff08 1 xff09 下载Maven xff1a xff08 2 xff09 解压Maven xff1a xff08 3 xff09 配置Maven环境变量到Path中 xff1a xff08 4 xff
  • Redis哨兵模式(一主二从三哨兵)

    目录 一 redis环境 xff1a 二 哨兵介绍 xff1a 三 安装redis 四 使用Redis主从复制的作用 xff1a 五 配置redis一主二从 xff1a redis启动前的准备工作 xff1a 六 配置redis三哨兵 xf
  • 微信登录的接口

    目录 第一步 xff1a 生成微信扫描二维码 网页内嵌的二维码 接口第二步 xff1a 处理微信回调 xff0c 获取扫描人信息 微信开放平台 xff1a https developers weixin qq com doc oplatfo
  • Linux安装MongoDB(简单详细)

    目录 MongoDB 安装环境1 下载 MongoDB 的linux安装包2 上传 MongoDB 安装包到linux系统中 xff1a 3 解压 MongoDB 安装包4 创建 MongoDB 必要目录5 移动 MongoDB 安装目录6
  • 镀镍的工艺

  • Solidworks学习一

    目录 页面介绍 xff1a 视图操作 xff1a 实例圆柱 xff1a 直线的绘制 xff1a 草图的保存和不保存 xff1a 绘制工具 xff1a 切线弧 xff1a 转换实体引用 xff1a 交叉曲线 xff1a 等距实体 xff1a
  • 螺纹的标记

    M2 xff1a 螺纹孔的画法 例如M2的螺纹 怎么画螺纹孔 1 外螺纹 xff0c 大径是螺纹标准值用粗实线画 xff0c 小径用细实线画 在沿端面看时 xff0c 大径是整圆 xff0c 小径是3 4圆 2 内螺纹 xff08 螺纹孔
  • c#日志组件Serilog使用

    NuGet 安装 Serilog 核心的包是 Serilog 和 Serilog AspNetCore 建议安装 Serilog AspNetCore xff0c 几乎包含了Serilog常用的所有包 异步写入 Serilog Sinks
  • Zynq-7000系列之linux开发学习笔记:PS和PL端的GPIO使用(三)

    开发板 xff1a Zynq7030数据采集板 PC平台 xff1a Ubuntu 18 04 43 MobaXterm 开发环境 xff1a Xilinx Vivado 43 SDK 18 3 学习目标 xff1a PS通过 EMIO A
  • 人工智能革命(上):通往超级智能之路

    导读 xff1a 本系列文章讲述了人工智能革命的爆发以及人类未来的出路 xff0c 由于篇幅较长分为上下两篇 xff0c 原英文载于神奇的网站 WaitButWhy com xff0c 作者Tim Urban还写过一篇有关脑机接口的文章 N
  • kubelet源码分析

    做个笔记记录k8s中赫赫有名的LIST amp WATCH 其实之前的文章中都有过watch的身影了 分别是informer篇和configCh篇这两篇其实都共用了client go包中的LIST amp WATCH方法 这篇内容详细讲一下
  • Li‘s 核磁共振影像数据处理-20-FSL数学工具fslmaths

    讲解视频内容请移步Bilibili xff1a https space bilibili com 542601735 入群讨论请加v hochzeitstorte 请注明 核磁共振学习 公众号 xff1a 美好事物中转站 FSLeyes F