Grid Mask Manhattan Dilation
Apply manhattan binary morphology in the original grid, radius 0–8, treating outside cells as zero; no automatic resizing or physical-distance model.
Description
Apply manhattan binary morphology in the original grid, radius 0–8, treating outside cells as zero; no automatic resizing or physical-distance model.
Manhattan dilation expands set cells through a diamond-shaped neighborhood measured by row/column distance.
When to use this tool
Apply manhattan binary morphology in the original grid, radius 0–8, treating outside cells as zero; no automatic resizing or physical-distance model.
- Prepare the supplied mask, radius fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter mask, radius. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.mask. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
For radius 0 to 8, set each output cell if any in-bounds one lies at abs(row offset)+abs(column offset) no greater than radius.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| mask | mask. | Numeric rows; at most 128 rows and 128 values per row |
| radius | radius. | Integer from 0 to 8 inclusive |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.mask | The mask list in the ordering and representation described above. |
{
"input": {
"mask": [
[
0,
0,
0
],
[
0,
1,
0
],
[
0,
0,
0
]
],
"radius": 1
},
"output": {
"result": {
"mask": [
[
0,
1,
0
],
[
1,
1,
1
],
[
0,
1,
0
]
]
}
}
} Limitations and assumptions
- The mask shape is unchanged and outside values are unset. This is not Euclidean-distance dilation or resizing.
- Coordinate pairs use [row,column] where stated. Masks are nonempty rectangular zero/one matrices of at most 128 rows, 128 columns and 16,384 cells; outside-mask values are unset for the neighborhood operations.
- Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
- String lists have at most 128 entries of at most 128 code units; matrices have at most 128 rows and columns. Larger numeric lists and parsed JSON have separate bounded budgets. Nonfinite results and excessively large serialized outputs are rejected.
- Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.
Alternative or Complementary methods
Keep row/column coordinates distinct from x/y pairs and byte offsets. Select the neighborhood metric, outside-mask rule and storage-order convention explicitly; these operations do not infer an image format.
References
Similar or alternative tools
- Grid Mask Chebyshev Dilation
Apply chebyshev binary morphology in the original grid, radius 0–8, treating outside cells as zero; no automatic resizing or physical-distance model.
- Grid Mask Boolean Combination
Combine identically shaped binary masks by explicit AND, OR, XOR or left difference; no resampling or alignment inference.