morpho {RGeostats}R Documentation

Morphological operations


Perform morphological operations on a variable defined on a Grid


morpho(dbin, vmin = NA, vmax = NA, 
       oper = "thresh", option = 0, radius = 1, extend=1, niter = 1, ccvoid=NA, 
       flag.dist=1, radix = NA, = db.locmod())



The db-class structure containing the variable to be processed


Minimum (inclusive) threshold for the grain definition


Maximum (exclusive) threshold for the grain definition


Name of the morphological operation:

  • thresh : Convert the input variable into the binary image

  • erode : Perform an erosion on the binary image

  • dilate : Perform a dilation on the binary image

  • open : Perform an opening (erosion then dilation) on the binary image

  • close : Perform a closing (dilation then erosion) on the binary image

  • cc : Calculate the connected components (cells are assigned the rank of the corresponding component)

  • ccsize : Calculate the connected components (cells are assigned the volume of the corresponding component)

  • dist : Calculate the distance to the pore edge

  • angle : Calculate the angle of the tangent to isovalues of a coloured image


Type of structuring element or connectivity:

  • 0 : Cross (6-connectivity in 3-D)

  • 1 : Block (26-connectivity in 3-D)


Radius of the structuring element in 3-D. Only used for 'erode', 'dilate', 'open', 'close' and 'dist' operations


Dimension of the isotropic neighborhood extension (counted in number if pixels) used with the option "angle"


Number of times the morphological operation is iterated. This argument is not used for the 'thresh', 'cc' and 'dist' operations


Value assigned to pixels which do not belong to any connected component.


The distance is calculated by inflating the grain (if flag-dist=1) or by shrinking it (flag.dist=0)


Radix of the name given to the variable storing the result in the Db. If not specified, the radix will be set to the name of the operation.

Decides whether or not the newly created variables will have their locator defined or not. For more information, see db.locmod.


The Db where the following variable has been added:

- the output image (converted into double) for 'thresh', 'erode', 'dilate', 'open', 'close' and 'dist' operations

- the output variable where each pixel is set to FFFF (for pore) or for the rank of the connected component (sorted by decreasing size)

[Package RGeostats version 11.1.2 Index]