#!/bin/sh
# Make image containing positive values only by thresholding at 0
fslmaths img -thr 0 img_pos
#!/bin/sh
# Apply multiple ordered operations:
# multiplication followed by thresholding
# and then making the image binary
fslmaths img -mul gm_mask -thr 0.5 -bin img_gm_bin
#!/bin/sh
# Make a 5 percent mask (default choice for fdt results).
# fdt is FSL's diffusion toolbox.
# Use following percentage (0-100) of ROBUST RANGE of
# non-zero voxels and threshold below that percentage
# Note that larger values are more stringent
fslmaths img -thrp 5 img_5p