ANTsX / ANTs

Advanced Normalization Tools (ANTs)
Apache License 2.0
1.17k stars 378 forks source link

iMath has many undocumented functions #600

Open gdevenyi opened 6 years ago

gdevenyi commented 6 years ago

The iMath help:

> iMath

Usage: iMath ImageDimension <OutputImage.ext> [operations and inputs] <Image1.ext> <Image2.ext>

Usage Information 
 ImageDimension: 2 or 3 (for 2 or 3 dimensional operations).
 ImageDimension: 4 (for operations on 4D file, e.g. time-series data).
 Operator: See list of valid operators below.

Mask and Label set operations
-----------------------------
  GetLargestComponent    : Get the single largest labeled object in an image
    Usage                : GetLargestComponent InputImage.ext {MinObjectSize=50}

Morphological operations
-----------------------------
Possible operations are:
  MC = Closing
  MD = Dilation
  ME = Erosion
  MO = Opening
Possible values for the shape parameter and associated settings are:
  ball {RadiusIsParmetric=0}
  box
  cross
  annulus {RadiusIsParametric=0} {Thickness=1} {IncludeCenter=0}
  polygon {Lines=3}
Description of Parameters
  RadiusIsParametric: The 'ball' and 'annulus' structuring elements have an optional flag called 'radiusIsParametric' (off by default). Setting this flag to true will use the parametric definition of the object and will generate structuring elements with more accurate areas, which can be especially important when morphological operations are intended to remove or retain objects of particular sizes. When the mode is turned off (default), the radius is the same, but the object diameter is set to (radius*2)+1, which is the size of the neighborhood region. Thus, the original ball and annulus structuring elements have a systematic bias in the radius of +0.5 voxels in each dimension relative to the parametric definition of the radius. Thus, we recommend turning this mode on for more accurate structuring elements, but this mode is turned off by default for backward compatibility.

  Usage : Operation InputImage.ext {Radius=1} {ObjectValue=1} {Shape=1} {RadiusIsParametric=0 or Lines=3} {Thickness=1} {IncludeCenter=0}

The iMath "operations":

> grep "operation ==" iMath.cxx 
// lists of 'if (operation == <op>)' clauses for 2d, 3d, and 4d. I
  if( operation == "BlobDetector" )
  else if( operation == "Canny" )
  else if( operation == "DistanceMap" )
  else if( operation == "FillHoles" )
  else if( operation == "GC" )
  else if( operation == "GD" )
  else if( operation == "GE" )
  else if( operation == "GO" )
  else if( operation == "GetLargestComponent" )
  else if( operation == "Grad" )
  else if( operation == "HistogramEqualization" )
  else if( operation == "Laplacian" )
  else if( operation == "MC" )
  else if( operation == "MD" )
  else if( operation == "ME" )
  else if( operation == "MO" )
  else if( operation == "MaurerDistance" )
  else if( operation == "Normalize" )
  else if( operation == "Pad" )
  else if( operation == "PeronaMalik" )
  else if( operation == "Sharpen" )
  else if (operation == "PropagateLabelsThroughMask" )
  else if( operation == "TruncateIntensity" )
gdevenyi commented 2 months ago

Following up here.