Methods and computer-readable mediums are provided for obtaining an optimally gated medical image. For example, in one embodiment, a method is provided that acquires medical images in list mode. The method also acquires a respiration correlated signal S(t). Thereafter, a final upper strain threshold value and a final lower strain threshold value pair that has a narrowest interval are selected. The medical images are synchronized with the respiration correlated signal S(t). The synchronized images and signal are used to create an optimally gated medical image. In various embodiments, the disclosed optimal gating can be utilized in PET systems and in other embodiments the disclosed optimal gating can be utilized in SPECT systems. In yet other embodiments, the optimally gated images can be matched to MRI systems and in still other embodiments, the optimally gated images can be matched to CT systems.