Respiratory motion degrades anatomic position reproducibility and leads to issues affecting image acquisition, treatment planning, and radiation delivery. Four-dimensional (4D) computer tomography (CT) image acquisition can be used to measure the impact of organ motion and to explicitly account for respiratory motion during treatment planning and radiation delivery. Modern CT scanners can only scan a limited region of the body simultaneously and patients have to be scanned in segments consisting of multiple slices. A respiratory signal (spirometer signal or surface tracking) is used to reconstruct a 4D data set by sorting the CT scans according to the couch position and signal coherence with predefined respiratory phases. But artifacts can occur if there are no acquired data segments for exactly the same respiratory state for all couch positions. These artifacts are caused by device-dependent limitations of gantry rotation, image reconstruction times and by the variability of the patient's respiratory pattern. In this paper an optical flow based method for improved reconstruction of 4D CT data sets from multislice CT scans is presented. The optical flow between scans at neighboring respiratory states is estimated by a non-linear registration method. The calculated velocity field is then used to reconstruct a 4D CT data set by interpolating data at exactly the predefined respiratory phase. Our reconstruction method is compared with the usually used reconstruction based on amplitude sorting. The procedures described were applied to reconstruct 4D CT data sets for four cancer patients and a qualitative and quantitative evaluation of the optical flow based reconstruction method was performed. Evaluation results show a relevant reduction of reconstruction artifacts by our technique. The reconstructed 4D data sets were used to quantify organ displacements and to visualize the abdominothoracic organ motion.