We describe an approach that we propose to model the electromechanical behavior of the heart, and to use the model in a data assimilation procedure in order to perform an identification of the parameters and state, based on image (MRI or ultrasound) measurements in particular. This procedure is intended to give access to quantities of interest for diagnosis purposes on individual patients. We report on numerical simulations and on validations of our approach.