The geometry and topology of shape patterns with applications to leukaemia