A Riemannian Approach for Spatiotemporal Analysis and Generation of 4D Tree-shaped Structures