Hierarchical Segmentation Using Tree-Based Shape Spaces