Objectives: Respiratory motion represents a major problem in radiotherapy of thoracic and abdominal tumors. Methods for compensation require comprehensive knowledge of underlying dynamics. Therefore, 40 (= 30 + 1) CT data can be helpful. But modern CT scanners cannot scan a large region of interest simultaneously. So patients have to be scanned in segments. Commonly used approaches for reconstructing the data segments into 4D CT images cause motion artifacts. In order to reduce the artifacts, a new method for 40 CT reconstruction is presented. The resulting data sets are used to analyze respiratory motion. Methods: Spatiotempotal CT image sequences of lung cancer patients were acquired using a multi-slice CT in cine mode during free breathing. 40 CT reconstruction was done by optical flow based temporal interpolation. The resulting 40 image data were compared with data generated by the commonly used nearest neighbor reconstruction. Subsequent motion analysis is mainly concerned with tumor mobility. Results: The presented optical flow-based method enables the reconstruction of 3D CT images at arbitrarily chosen points of the patient's breathing cycle. A considerable reduction of motion artifacts has been proven in eight patient data sets. Motion analysis showed that tumor mobility differs strongly between the patients. Conclusions: Due to the proved reduction of motion artifacts, the optical flow-based 4D CT reconstruction offers the possibility of high-quality motion analysis. Because the method is based on an interpolation scheme, it additionally has the potential to enable the reconstruction of 4D CT data from a lesser number of scans.