The continuing research and further development in flat panel detector technology have led to its integration into more and more medical x-ray systems for two-dimensional (2D) and three-dimensional (3D) imaging, such as fixed or mobile C arms. Besides the obvious advantages of flat panel detectors, like the slim design and the resulting optimum accessibility to the patient, their success is primarily a product of the image quality that can be achieved. The benefits in the physical and performance-related features as opposed to conventional image intensifier systems, (e.g., distortion-free reproduction of imaging information or almost linear signal response over a large dynamic range) can be fully exploited, however, only if the raw detector images are correctly calibrated and postprocessed. Previous procedures for processing raw data contain idealizations that, in the real world, lead to artifacts or losses in image quality. Thus, for example, temperature dependencies or changes in beam geometry, as can occur with mobile C arm systems, have not been taken into account up to this time. Additionally, adverse characteristics such as image lag or aging effects have to be compensated to attain the best possible image quality. In this article a procedure is presented that takes into account the important dependencies of the individual pixel sensitivity of flat panel detectors used in 2D or 3D imaging and simultaneously minimizes the work required for an extensive recalibration. It is suitable for conventional detectors with only one gain mode as well as for the detectors specially developed for 3D imaging with dual gain read-out technology.