def setup_channels(roi, channel, dim_channel):
    """Setup channels array for the given ROI dimensions.
    
    Args:
        roi (:obj:`np.ndarray`): Region of interest, which is either a 3D
            or 4D array in the formate ``[[z, y, x, (c)], ...]``.
        channel (List[int]): Channels to select, which can be None to indicate
            all channels.
        dim_channel (int): Index of the channel dimension.
    
    Returns:
        bool, List[int]: A boolean value where True indicates that
        the ROI is multichannel (ie 4D) and an array of the channel indices
        of ``roi`` to include, which is the same as ``channel`` for
        multichannel ROIs or only the first element if ``roi`` is single
        channel.
    """
    multichannel = roi.ndim > dim_channel
    channels = channel
    if multichannel:
        if channel is None:
            # None indicates all channels
            channels = range(roi.shape[dim_channel])
    else:
        # only use the first given channel if ROI is single channel
        channels = [0]
    return multichannel, channels