From SlicerWiki
Jump to: navigation, search
Home < Modules:OtsuThresholdSegmentation-Documentation-3.6

Return to Slicer 3.6 Documentation

Module Name

Otsu Threshold Segmentation

General Information

Module Type & Category

Type: CLI

Category: Segmentation

Authors, Collaborators & Contact

  • Author: Bill Lorensen
  • Contact: bill.lorensen at

Module Description

This filter creates a labeled image from a grayscale image. First, it calculates an optimal threshold that separates the image into foreground and background. This threshold separates those two classes so that their intra-class variance is minimal (see Then the filter runs a connected component algorithm to generate unique labels for each connected region of the foreground. Finally, the resulting image is relabeled to provide consecutive numbering.

The original reference is: N.Otsu, ‘‘A threshold selection method from gray level histograms,’’ IEEE Trans.Syst.ManCybern.SMC-9,62–66 1979.


 OtsuThresholdSegmentation [--returnparameterfile
                           <std::string>] [--xml] [--echo]
                           [--minimumObjectSize <int>]
                           [--faceConnected] [--numberOfBins
                           <int>] [--brightObjects] [--]
                           [--version] [-h] <std::string>
   --returnparameterfile <std::string>
     Filename in which to write simple return parameters (int, float,
     int-vector, etc.) as opposed to bulk return parameters (image,
     geometry, transform, measurement, table).
   --processinformationaddress <std::string>
     Address of a structure to store process information (progress, abort,
     etc.). (default: 0)
     Produce xml description of command line arguments (default: 0)
     Echo the command line arguments (default: 0)
   --minimumObjectSize <int>
     Minimum size of object to retain. This parameter can be used to get
     rid of small regions in noisy images. (default: 0)
     This is an advanced parameter. Adjacent voxels are face connected.
     This affects the connected component algorithm. If this parameter is
     false, more regions are likely to be identified. (default: 0)
   --numberOfBins <int>
     This is an advanced parameter. The number of bins in the histogram
     used to model the probability mass function of the two intensity
     distributions. Small numbers of bins may result in a more conservative
     threshold. The default should suffice for most applications.
     Experimentation is the only way to see the effect of varying this
     parameter. (default: 128)
     Segmenting bright objects on a dark background or dark objects on a
     bright background. (default: 0)
   --,  --ignore_rest
     Ignores the rest of the labeled arguments following this flag.
     Displays version information and exits.
   -h,  --help
     Displays usage information and exits.
     (required)  Input volume to be segmented
     (required)  Output filtered

Source code & documentation

Source Code: OtsuThresholdSegmentation.cxx

XML Description: OtsuThresholdSegmentation.xml

More Information


This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Information on the National Centers for Biomedical Computing can be obtained from National Centers for Biomedical Computing.