Echocardiography is a painless and non-invasive test that uses ultrasound waves to take pictures and videos of your heart. The image is an echocardiogram. This test assesses how your heart and its valves are functioning in addition to assessing the functional and pumping ability of the heart muscles especially after you have had a heart attack.