Electrocardiographic imaging for cardiac arrhythmias and resynchronization therapy