# Pixel Count

The Pixel Count tool allows you to determine whether a feature is present or not based on the number of pixels in the defined region. The Pixel Count tool automatically computes the optimal greyscale threshold values (0 - 255) within which the tool performs a count of the pixels that pass the threshold definition.

To add the Pixel Count tool to your job:

1. Open the Inspect tool palette, expand the Presence/Absence tool group, and select the Pixel Count tool.

2. In the dialog that appears, define the region by resizing and repositioning the box on the acquisition display screen. You can change the shape of the box using the Search Shape dropdown on the right. The available shapes are Rectangle, Circle, Annulus, and Polygon.

3. You can also add a subregion to your model region to mask out irrelevant or confusing features by right clicking on the acquisition display screen, and selecting Add Subregion > Shape in the dropdown menu that appears. By default, the subregion is added to the model region, but you can change it to subtract by right clicking on the acquisition screen, and selecting Subregion Operation > Subtract in the dropdown menu.

4. Click OK.

To change the threshold settings:

To enable manual threshold configuration, disable the Auto toggle. If Auto is enabled, all other settings in the Threshold section are disabled.

Toggle the Normal/Inverted toggle to invert the threshold settings. When set to Normal, the Pixel Count tool counts all pixels within the threshold values. When set to Inverted, the Pixel Count tool counts all pixels outside the threshold values.

Change the minimum and maximum threshold values using the sliders or by providing the numerical values in the boxes below.

To adjust range limits:

Toggle the Normal/Inverted toggle to change the way the tool result is generated. If set to Normal, the tool produces a passing result if the number of pixels falls between the defined minimum and maximum values. If set to Inverted, the tool produces a passing result if the number of pixels falls outside the defined minimum and maximum values.

Adjust the valid range by changing the Minimum and Maximum number of pixels using the sliders or by providing the numerical values in the boxes below.

Click Set Min/Max to use automatically calculated minimum and maximum number of pixels. The automatically calculated minimum and maximum values are 10% below and above the current number of pixels within the defined region when you add the tool or click the Set Min/Max button.

You can also enable advanced tool settings if your job requires more complex configuration. For more information on the advanced tool settings that are available, see Advanced Tool Settings.