Investigation of capillary collapse in granular materials by x-ray microtomography