Deep generative model for synthesising and analysing cardiac magnetic resonance images