Foreground masking (BRAINS)


This program is used to create a mask over the most prominent foreground region in an image. This is accomplished via a combination of otsu thresholding and a closing operation.

Panels and their use

IO: Input/output parameters

  • Input Image Volume (inputVolume): The input image for finding the largest region filled mask.

  • Output Mask (outputROIMaskVolume): The ROI automatically found from the input image.

  • Output Image (outputVolume): The inputVolume with optional [maskOutput|cropOutput] to the region of the brain mask.

  • Mask Output (maskOutput): The inputVolume multiplied by the ROI mask.

  • Output Image Clipped by ROI (cropOutput): The inputVolume cropped to the region of the ROI mask.

Configuration Parameters:

  • Otsu Percentile Threshold (otsuPercentileThreshold): Parameter to the Otsu threshold algorithm.

  • Otsu Correction Factor (thresholdCorrectionFactor): A factor to scale the Otsu algorithm’s result threshold, in case clipping mangles the image.

  • Closing Size (closingSize): 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 (ROIAutoDilateSize): This flag is only relevant 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 (outputVolumePixelType): The output image Pixel Type is the scalar datatype for representation of the Output Volume.

  • Number Of Threads (numberOfThreads): Explicitly specify the maximum number of threads to use.


Hans J. Johnson, hans-johnson -at-,


Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3); Andriy Fedorov(5), fedorov -at- (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard)