  In shape analysis, the concept of shape spaces has always been vague,
requiring a case-by-case approach for every new type of shape. In this paper,
we give a general definition for an abstract space of shapes in a manifold.
This notion encompasses every shape space studied so far in the literature, and
offers a rigorous framework for several possible generalizations. We then give
the appropriate setting for LDDMM methods of shape analysis, which arises
naturally as a sub-Riemannian structure on a shape space. This structure is
deduced from the space of infinitesimal deformations and their infinitesimal
action. We then describe the properties of the Hamiltonian geodesic flow, and
study several applications of equivariant mappings between shape spaces.
