def get_feature_channels_per_level(base_feature_channels, max_feature_channels, num_levels, decoder_min_channels=None):
    """Get the number of output channels for each of the encoder and decoder blocks.

    Args:
        base_feature_channels (int): number of the output channels of the first block in the encoder part.
            Number of the output channels of the encoder blocks is given by the geometric progression: `base_feature_channels` ** `k` (`k`: level of the encoder block).
        max_feature_channels (int): max output channels of the encoder/decoder blocks.
        num_levels (int): number of the levels (= blocks) in the encoder/decoder part.
        decoder_min_channels (int, optional): min output channels of the decoder blocks. Defaults to None.

    Returns:
        tuple[list[int]]: encoder output channels and decoder output channels.
    """
    # output channels of the encoder blocks
    encoder_feature_channels = [min(max_feature_channels, base_feature_channels * (2**i)) for i in range(num_levels)]

    # output channels of the decoder blocks
    decoder_feature_channels = list(reversed(encoder_feature_channels))[1:]
    if decoder_min_channels is not None:
        for i in range(len(decoder_feature_channels)):
            decoder_feature_channels[i] = max(decoder_min_channels, decoder_feature_channels[i])

    return encoder_feature_channels, decoder_feature_channels