def METHOD_NAME(layer, width, height, condition):
    depth, version = layer._psd.depth, layer._psd.version
    iterator = zip(layer._record.channel_info, layer._channels)
    channels = [
        _parse_array(data.get_data(width, height, depth, version), depth)
        for info, data in iterator
        if condition(info) and len(data.data) > 0
    ]
    if len(channels) and channels[0].size > 0:
        result = np.stack(channels, axis=1).reshape((height, width, -1))
        expected_channels = EXPECTED_CHANNELS.get(layer._psd.color_mode)
        if result.shape[2] > expected_channels:
            logger.debug('Extra channel found')
            return result[:, :, :expected_channels]
        return result
    return None