A property of a treatment beam is controlled during a scanning period. A portion of a region is exposed to an imaging x-ray beam during a scanning period, the imaging x-ray beam being generated by an electron-beam scanner. X-ray radiation from the region is detected, the x-ray radiation representing an attenuation of the imaging x-ray beam caused by the portion of the region. A first image of the portion of the region is generated based on the detected x-ray radiation. A characteristic of the portion of the region is determined from the generated first image. An input derived from the characteristic is generated, the input configured to cause a source of a treatment beam to modify a property of the treatment beam. The source of the treatment beam modifies a property of the treatment beam during the scanning period by providing the input to the source of the treatment beam.