Differences between revisions 6 and 7
Deletions are marked like this. Additions are marked like this.
Line 46: Line 46:
||--inv || set binval=0, binvalnot=1 ||detailed description (eg, help file information) || ||--inv || set binval=0, binvalnot=1 || ||
Line 50: Line 50:
||--frameno || Use give frame of the input, 0-based, default is 0. || ||
Line 60: Line 61:
||--erode-face nerode || Erode binarization using 'face' nearest neighbor || ||
||--erode-edge nerode || Erode binarizaiton using 'edge' nearest neighbor || ||
||--erode-corner nerode || Erode binarization using 'corner' nearest neighbor, same as --erode || ||
||--bb npad || Reduce dim of output to the minimum volume of non-zero voxels with npad boundary || ||
||--surf surfname || Create a surface mesh from the binarization || ||
||--surf-smooth niteration || Iteratively smooth the surface mesh || ||
||--noverbose || Default is verbose || ||
||--uchar || Save output file in 'uchar' format || ||
Line 63: Line 72:
||--uchar || Save output file in 'uchar' format || || ||--debug || Turns on debugging || ||

Index

Name

mri_binarize

Description

Program to binarize a volume (or volume-encoded surface file). Can also be used to merge with other binarizations. Binarization can be done based on threshold or on matched values.

Synopsis

mri_binarize --i <invol> --o <outvol>

Arguments

Required Flagged Arguments

--i <invol>

input volume to be binarized

--o <outvol>

path to output volume

Optional Flagged Arguments

--min

Minimum voxel threshold (default is -infinity)

Cannot be used with --match

--max

Maximum voxel threshold (default is infinity)

Cannot be used with --match

--pct P

Set threshold to capture top P% (in mask or total volume)

Set min threshold so that the top P percent of the voxels are captured in the output mask. The percent will be computed based on the number of voxels in the volume (if not input mask is specified) or within the input mask.

--rimin rmin

Compute minimum based on rmin*globalmean

--rmax rmax

Compute maximum based on rmax*globalmean

--fdr fdrthres

Compute min based on FDR assuming -log10(p) input. --fdr-pos, -fdr-neg, fdr-abs (use only pos, neg, or abs). Abs is the default.

Set min threshold to achieve a given FDR. By default, it uses the absolute value but this can be changed with --fdr-pos and --fdr-neg. If a mask is passed, it will compute the voxel-wise threshold only with in the places where mask > 0.5. The mask threshold will be ignored.

--match matchval <matchval2 ...>

Use match instead of threshold

Any number of match values can be specified. Cannot be used with --min/--max.

--replaceonly V1 V2

Replace voxels equal to V1 with V2 and propagate other src voxels instead of binarizing

--replace V1 V2

Replace voxels equal to V1 with V2

Replace every occurrence of (int) value V1 with value V2. Multiple --replace args are possible.

--ctx-wm

Set match vals to 2, 41, 77, 251-255 (aseg for cerebral WM)

--all-wm

Set match vals to 2, 41, 77, 251-255, 7, and 46 (aseg for all WM)

--ventricles

Set match vals those for aseg ventricles+choroid (not 4th)

--wm+vcsf

WM and ventricular CSF, including choroid (not 4th)

--gm

Match for all Wm and VCSF and background, then invert

--subcort-gm

Subcortical gray matter

--count countfile

Save number of hits in ascii file

Four numbers are saved: the number of voxels that match(nhits), the volume of the voxels that match, the total number of voxels in the volume (nvoxtot), and the percent matching (100*nhits/nvoxtot).

-no-count

Turn off counting number of voxels in the first frame (good for large volumes)

--binval val

Set voxels within threshold to val (default is 1)

Value to use for those voxels that are in the threshold/match (--binval) or out of the range (--binvalnot). These must be integer values.

--binvalnot notval

Set voxels outside range to notval (default is 0)

Value to use for those voxels that are in the threshold/match (--binval) or out of the range (--binvalnot). These must be integer values. Only applies when a merge volume is NOT specified.

--inv

set binval=0, binvalnot=1

--frame frame#

Use 0-based frame of input (default is 0)

--frame-sum

Sum frames together before binarizing

--frame-and

Take intersection (AND) of frames

You do not need to specify a --min (the min will be set to nframes-0.5).

--frameno

Use give frame of the input, 0-based, default is 0.

--merge mergevol

Merge with mergevolume

mergevol must be the same dimension as the input volume. Combining this with --binval allows you to construct crude segmentations.

--mask maskvol

Mask input with maskvol

--mask-thresh thresh

Set threshold for mask (default is 0.5)

--abs

Take abs of invol first (ie, make unsigned)

--bincol

Set binarized voxel value to its column number

--zero-edges

Set edge voxels to zero

--zero-slice-edges

Set edge slice voxels to zero

--dilate ndilate

Dilate binarization in 3D

--erode nerode

Erode binarization in 3D (after any dilation)

--erode2d nerode2d

Erode binarization in 2D (after any 3D erosion)

--erode-face nerode

Erode binarization using 'face' nearest neighbor

--erode-edge nerode

Erode binarizaiton using 'edge' nearest neighbor

--erode-corner nerode

Erode binarization using 'corner' nearest neighbor, same as --erode

--bb npad

Reduce dim of output to the minimum volume of non-zero voxels with npad boundary

--surf surfname

Create a surface mesh from the binarization

--surf-smooth niteration

Iteratively smooth the surface mesh

--noverbose

Default is verbose

--uchar

Save output file in 'uchar' format

--checkopts

Don't run anything, just check options and exit

--help

Print out information on how to use this program

--version

Print out version and exit

--debug

Turns on debugging

Outputs

volume1

description

volume2

description

Examples

Example 1

mri_binarize --i yoursubjectname/mri/aseg.mgz --match 17 --o left_hip.nii

Creates a binary mask (.nii) of the left hippocampus from the subject aseg.mgz.

Example 2

mri_binarize --i aseg.mgz --o left_hippocampus.mgz --match 17

description

Bugs

None

See Also

othercommand1, othercommand2

Links

FreeSurfer, FsFast

Reporting Bugs

Report bugs to < analysis-bugs@nmr.mgh.harvard.edu >

Author/s

mri_binarize (last edited 2017-11-27 13:29:25 by MorganFogarty)