From Slicer Wiki
Jump to: navigation, search
Home < Documentation < 4.3 < Modules < ForegroundMasking

For the latest Slicer documentation, visit the 4.10 page.

Introduction and Acknowledgements

This work is part of the National Alliance for Medical Image Computing (NA-MIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Information on NA-MIC can be obtained from the NA-MIC website.
Author: Hans Johnson, UIOWA
Contact: Hans Johnson, <email>(</email>

University of Iowa  
Surgical Planning Laboratory  

Module Description

This program is used to create a mask over the most prominant forground region in an image. This is accomplished via a combination of otsu thresholding and a closing operation. More documentation is available here:

Use Cases

Most frequently used for these scenarios:

  • Use Case 1: Creating a rough brain mask.
  • Use Case 2:


Links to tutorials that use this module

Panels and their use


  • IO: Input/output parameters
    • Input Image Volume: The input image for finding the largest region filled mask.
    • Output Mask: The ROI automatically found from the input image.
    • Output Image: The inputVolume with optional [maskOutput|cropOutput] to the region of the brain mask.
    • Mask Output: The inputVolume multiplied by the ROI mask.
    • Output Image Clipped by ROI: The inputVolume cropped to the region of the ROI mask.
  • Configuration Parameters:
    • Otsu Percentile Threshold: Parameter to the Otsu threshold algorithm.
    • Otsu Correction Factor: A factor to scale the Otsu algorithm's result threshold, in case clipping mangles the image.
    • Closing Size: The Closing Size (in millimeters) for largest connected filled mask. This value is divided by image spacing and rounded to the next largest voxel number.
    • ROIAuto Dilate Size: This flag is only relavent when using ROIAUTO mode for initializing masks. It defines the final dilation size to capture a bit of background outside the tissue region. At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better.
    • Output Image Pixel Type: The output image Pixel Type is the scalar datatype for representation of the Output Volume.
    • Number Of Threads: Explicitly specify the maximum number of threads to use.

Similar Modules

  • Point to other modules that have similar functionality


Publications related to this module go here. Links to pdfs would be useful. For extensions: link to the source code repository and additional documentation

Information for Developers