Cardiac trabeculae are widely used as experimental muscle preparations for studying heart muscle. However, their geometry (diameter, length, and shape) can vary not only among samples, but also within a sample, leading to inaccuracies in estimating their stress production, volumetric energy output, and/or oxygen consumption. Hence, it is desirable to have a system that can accurately image each trabecula in vitro during an experiment. To this end, we constructed an optical coherence tomography system and implemented a gated imaging procedure to image actively contracting trabeculae and reconstruct their time-varying geometry. By imaging a single cross section while monitoring the developed force, we found that gated stimulation of the muscle was sufficiently repeatable to allow us to reconstruct multiple contractions to form a four-dimensional representation of a single muscle contraction cycle. The complete muscle was imaged at various lengths and the cross-sectional area along the muscle was quantified during the contraction cycle. The variation of cross-sectional area along the length during a contraction tended to increase as the muscle was contracting, and this increase was greater at longer muscle lengths. To our knowledge, this is the first system that is able to measure the geometric change of cardiac trabeculae in vitro during a contraction, allowing cross-sectional stress and other volume-dependent parameters to be estimated with greater accuracy.