import copy


def maskVolume(volume, mask):
    """
    Apply the given volume mask to the given volume.

    Parameters
    ----------
    volume : ndarray
        Volume to be masked.
    mask : ndarray
        Mask to be applied.
    
    Returns
    -------
    newVolume : ndarray
        The resulting masked volume.
    """
    newVolume = copy.deepcopy(volume)
    newVolume[mask == 0] = 0

    return newVolume