Abstract. Deformations, and dieormophisms in particular, have played a tremendous role in the eld of statistical shape analysis, as a proxy to measure and interpret dierences between similar objects but with dierent shapes. Dieomorphisms usually result from the integration of a ow of regular velocity elds, whose parameters have not enabled so far a full control of the local behaviour of the deformation.In this work, we propose a new mathematical and computational framework, in which these velocity elds are constrained to be built through a combination of local deformation modules with few degrees of freedom. Deformation modules contribute to the global velocity eld, and interact with it during integration so that the local modules are transported by the global dieomorphic deformation under construction. Such modular dieomorphisms are used to deform shapes and to provide the shape space with a sub-Riemannian metric.We then derive a method to estimate a Fréchet mean from a series of observations, and to decompose the variations in shape observed in the training samples into a set of elementary deformation modules encoding distinctive and interpretable aspects of the shape variability. We show how this approach brings new solutions to long lasting problems in the elds of computer vision and medical image analysis. For instance, the easy implementation of priors in the type of deformations oers a direct control to favor one solution over another in situations where multiple solutions may t the observations equally well. It allows also the joint optimisation of a linear and a non-linear deformation between shapes, the linear transform simply being a particular type of modules.The proposed approach generalizes previous methods for constructing dieomorphisms and opens up new perspectives in the eld of statistical shape analysis.