This functionality was originally introduced to remove inclusions of certain phases within another phase. We are however simply looking for neighbouring pixels here. As this is still effective with small inclusions, for larger ones, repeated calls of this function may be required. Note however that this also affects pixels of the phase to modify that are not inclusions but just neighbouring pixels of the target phase.

phase_merge(img, phase, into)

Arguments

img

A 2D array.

phase

The phase to modify.

into

The phase to change pixels to.

Value

The modified 2D array.