10.46. Compute Statistics Within Bounding Boxes
Group (Subgroup)
Statistics
Description
NOTE: This filter allows each Cell value to contribute to 0 or more bounding boxes (a 1-to-many architecture). This comes with the caveat that the Standardize Data option offered by Compute Attribute Array Statistics cannot be included as functionality in this filter.
This filter computes a variety of statistics for a given scalar array, restricted to the Cells that fall inside each supplied bounding box. Because boxes may overlap (or leave gaps), a single Cell may be counted toward several boxes, exactly one box, or none. The currently available statistics are array length, minimum, maximum, (arithmetic) mean, median, mode, standard deviation, summation, and number of unique values; any combination of these statistics may be computed. Any scalar array, of any primitive type, may be used as input. The type of each output array depends on the kind of statistic computed:
Statistic |
Primitive Type |
|---|---|
Length |
signed 64-bit integer |
Minimum |
same type as input |
Maximum |
same type as input |
Mean |
32-bit float |
Median |
32-bit float |
Mode |
same type as input |
Standard Deviation |
32-bit float |
Summation |
32-bit float |
Number of Unique Values |
signed 32-bit integer |
The Unified Bounds Array is a 6-component DataArray that contains the lower XYZ bound and upper XYZ bound for each bounding box. The component ordering is {Min-X, Min-Y, Min-Z, Max-X, Max-Y, Max-Z}. These bounds are expressed in the Geometry’s physical coordinate units (the same length units as the geometry’s origin and spacing, typically microns). This ordering is provided so the user knows how to format imported external data. The Compute Feature Bounding Boxes filter’s Unified Array option produces a correctly formatted array for input to this filter.
The user must select or create a destination Attribute Matrix in which the computed statistics are stored. When selecting an existing Attribute Matrix, a reasonable choice is the Attribute Matrix that the Unified Bounds Array comes from. However, the only requirement is that the number of tuples in the selected destination Attribute Matrix match the number of tuples (boxes) in the Unified Bounds Array. This requirement is enforced during preflight. If the option to create a new Attribute Matrix is selected, it is created in the supplied Geometry, sized appropriately.
Special operations occur for certain statistics if the supplied array is of type bool (for example, a mask array produced by Multi-Threshold Objects). The length, minimum, maximum, median, mode, and summation are computed as normal (although the resulting values may be platform dependent). The mean and standard deviation for a boolean array are true if there are more instances of true in the array than false. These operations for boolean inputs are chosen as a basic convention, and are not intended to be representative of true boolean logic.
Required Input Sources
Unified Bounds Array – a 6-component bounds array produced by the Unified Array output option of Compute Feature Bounding Boxes.
Input Data
Parameter Name |
Parameter Type |
Parameter Notes |
Description |
|---|---|---|---|
Selected Image Geometry |
Geometry Selection |
Image |
The DataPath to the Geometry that contains the points/edges/faces for the geometry |
Attribute Array to Compute Statistics |
Array Selection |
Allowed Types: int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64 Comp. Shape: 1 |
Input Attribute Array for which to compute statistics |
Unified Bounding Boxes Array |
Array Selection |
Allowed Types: float32 Comp. Shape: 6 |
The array containing the min and max point of the bounding box for each feature |
Output Destination
Parameter Name |
Parameter Type |
Parameter Notes |
Description |
|---|---|---|---|
Create New AM For Statistics Arrays |
Bool |
If true new Attribute Matrix will be created to store statistics, else you will be prompted to select existing AM matching unified bounds tuple count |
|
Output Statistics Attribute Matrix Path |
AttributeMatrixSelection |
The output Attribute Matrix that the statistics arrays will be placed into. Must match unified bounds array tuple count. |
|
Statistics Attribute Matrix Name |
DataObjectName |
The name of the created bounding box statistics Attribute Matrix |
Output Arrays
Parameter Name |
Parameter Type |
Parameter Notes |
Description |
|---|---|---|---|
Bounding-Box-Has-Data Array Name |
DataObjectName |
The name of the boolean array that indicates whether or not each bounding box contains any data. This array is especially useful to help determine whether or not the outputted statistics are actually valid or not for a given bounding box. |
|
Calculate Length |
Bool |
Whether to compute the length of the input array |
|
Length Array Name |
DataObjectName |
The name of the length array |
|
Calculate Minimum |
Bool |
Whether to compute the minimum of the input array |
|
Minimum Array Name |
DataObjectName |
The name of the minimum array |
|
Calculate Maximum |
Bool |
Whether to compute the maximum of the input array |
|
Maximum Array Name |
DataObjectName |
The name of the maximum array |
|
Calculate Mean |
Bool |
Whether to compute the arithmetic mean of the input array |
|
Mean Array Name |
DataObjectName |
The name of the mean array |
|
Calculate Median |
Bool |
Whether to compute the median of the input array |
|
Median Array Name |
DataObjectName |
The name of the median array |
|
Calculate Mode |
Bool |
Whether to compute the mode of the input array |
|
Mode Array Name |
DataObjectName |
The name of the mode array |
|
Calculate Standard Deviation |
Bool |
Whether to compute the standard deviation of the input array |
|
Standard Deviation Array Name |
DataObjectName |
The name of the standard deviation array |
|
Calculate Summation |
Bool |
Whether to compute the summation of the input array |
|
Summation Array Name |
DataObjectName |
The name of the summation array |
|
Calculate Number of Unique Values |
Bool |
Whether to compute the number of unique values in the input array |
|
Number of Unique Values Array Name |
DataObjectName |
The name of the array which stores the calculated number of unique values |
Example Pipelines
License & Copyright
Please see the description file distributed with this plugin.
DREAM3D-NX Help
If you need help, need to file a bug report or want to request a new feature, please head over to the DREAM3DNX-Issues GitHub site where the community of DREAM3D-NX users can help answer your questions.