Masks values of data feature with a given mask of given mask type. The masking is done by assigning
        `numpy.nan` value.

        :param feature_data: Data array which will be masked
        :type feature_data: numpy.ndarray
        :param mask: Mask array
        :type mask: numpy.ndarray
        :param mask_type: Feature type of mask
        :type mask_type: FeatureType
        :return: Masked data array
        :rtype: numpy.ndarray

def _mask_feature_data(feature_data, mask, mask_type):
        """ Masks values of data feature with a given mask of given mask type. The masking is done by assigning
        `numpy.nan` value.

        :param feature_data: Data array which will be masked
        :type feature_data: numpy.ndarray
        :param mask: Mask array
        :type mask: numpy.ndarray
        :param mask_type: Feature type of mask
        :type mask_type: FeatureType
        :return: Masked data array
        :rtype: numpy.ndarray
        """

        if mask_type.is_spatial() and feature_data.shape[1: 3] != mask.shape[-3: -1]:
            raise ValueError('Spatial dimensions of interpolation and mask feature do not match: '
                             '{} {}'.format(feature_data.shape, mask.shape))

        if mask_type.is_time_dependent() and feature_data.shape[0] != mask.shape[0]:
            raise ValueError('Time dimension of interpolation and mask feature do not match: '
                             '{} {}'.format(feature_data.shape, mask.shape))

        # This allows masking each channel differently but causes some complications while masking with label
        if mask.shape[-1] != feature_data.shape[-1]:
            mask = mask[..., 0]

        if mask_type is FeatureType.MASK:
            feature_data[mask, ...] = np.nan

        elif mask_type is FeatureType.MASK_TIMELESS:
            feature_data[:, mask, ...] = np.nan

        elif mask_type is FeatureType.LABEL:
            np.swapaxes(feature_data, 1, 3)
            feature_data[mask, ..., :, :] = np.nan
            np.swapaxes(feature_data, 1, 3)

        return feature_data