fslmaths

本文详细解释了FSLMaths工具中的各种功能,包括数据类型设置、二进制和单值运算、矩阵运算、滤波、降维统计以及多参数操作,还介绍了如何结合4D和3D图像进行计算。
摘要由CSDN通过智能技术生成

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 : threshold below the following number (zero anything below the number)
-thrp : threshold below the following percentage (0-100) of ROBUST RANGE
-thrP : threshold below the following percentage (0-100) of the positive voxels’ ROBUST RANGE
-uthr : upper-threshold above the following number (zero anything above the number)
-uthrp : upper-threshold above the following percentage (0-100) of the ROBUST RANGE
-uthrP : upper-threshold above the following percentage (0-100) of the positive voxels’ ROBUST RANGE
-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
-dog_edge : difference of gaussians edge filter. Typical sigma1 is 1.0 and sigma2 is 1.6
-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
  • 12
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值