niworkflows.interfaces.morphology module

Mathematical morphology operations as nipype interfaces.

class niworkflows.interfaces.morphology.BinaryDilation(from_file=None, resource_monitor=None, **inputs)[source]

Bases: SimpleInterface

Binary dilation of a mask.

Mandatory Inputs:

in_mask (a pathlike object or string representing an existing file) – Input mask.

Optional Inputs:

radius (an integer) – Radius of dilation. (Nipype default value: 2)

Outputs:

out_mask (a pathlike object or string representing a file) – Dilated mask.

class niworkflows.interfaces.morphology.BinarySubtraction(from_file=None, resource_monitor=None, **inputs)[source]

Bases: SimpleInterface

Binary subtraction of two masks.

Mandatory Inputs:
  • in_base (a pathlike object or string representing an existing file) – Input base mask.

  • in_subtract (a pathlike object or string representing an existing file) – Input subtract mask.

Outputs:

out_mask (a pathlike object or string representing a file) – Subtracted mask.

niworkflows.interfaces.morphology.image_binary_dilation(in_mask, radius=2)[source]

Dilate the input binary mask.

Parameters:
  • in_mask (numpy.ndarray) – A 3D binary array.

  • radius (int, optional) – The radius of the ball-shaped footprint for dilation of the mask.