A rigorous algebraic-analytical method for pore network extraction from micro-tomography images