Medical imaging and localization methods and systems for producing a motion-compensated image of a planning target volume (PTV) of a patient. In one embodiment, an imaging and localization system includes sensors that are positioned to receive an electromagnetic location signal from one or more active markers affixed to or adjacent a PTV. A signal processing component can produce real-time localization data corresponding to the location signal, and a system interface can receive such localization data. The system interface can also receive raw image data from an imaging subsystem and process the raw image data based on the localization data. For example, the imaging subsystem can include a computed tomography (CT) imaging system and image slices or frames can be binned based on the localization data.