This document includes a concept part of Mathematical Morphological Filters (MMF) and some LabVIEW codes to apply MMF.
Mathematical Morphological Filters are very popular in image processing. You could use morphological filters to detect features or remove noises. MMF could also be applied into 1D signal processing. You will find the behaviour of 1D MMF is very similar to 2D MMF.
A dilation 1D MMF is using a structure element (SE) (similar to mask or template in image processing) to slide along the 1D signal and caculating the maximum.
Suppose we have a signal with two pulses. The pulse width is 20. If we use a SE with 10 samples of zero amplitude, the result signal will have wider pulses than the original signal. The result is something like "dilation".

If we use a SE with 35 samples, the result signal will have only one much wider pulse.

Erosion is the opposite of dilation. An erosion 1D MMF is using a structure element (SE) to slide along the 1D signal and caculating the minimum.
Take the same signal above as an example. If we use a SE with 10 samples of zero amplitude, the result signal will have narrower pulses than the original signal. The result is something like "erosion".

If we use a SE with 35 samples, the result signal will have no pulse just like the SE has eaten the two pulses.

Like "close" in image processing, it is composed of two operations: dilation first, erosion second. This operation will retain the wider pulse just like upper envelop if we use a long SE.
Take the same signal above as an example. If we use a SE with 35 samples of zero amplitude, we will obtain the envelop which is the wider pulse:

Open is the opposite of close, It is composed of two operations: erosion first, and dilation second. This operation will retain the wider pit just like lower envelop if we use a long SE.
Take the same signal above as an example. If we use a SE with 35 samples of zero amplitude, we will obtain a zero line as the signal has no pit.
As close and open could obtain the envelop of signal, we could use a suitable combination to extract the baseline.
For example, the input signal has 2 positive pulses and 2 negative pulses and includes a baseline. If we still use a SE with 35 samples of zero amplitude and use close operation on it, we could obtain:

If we use open operation on it, we could obtain:

So if we use close firstly to remove the negative pulses and use open secondly to remove the positive pulses, we will extract the baseline from the original signal.
MMF could also be applied to noise suppression if we use a suitable SE. For example, in ECG preprocessing:

The attachment is a simple concept demo of MMF. It includes:
very well document!