Computed tomography (CT) imaging became an indispensable modality exploited across a vast spectrum of clinical indications for diagnosis and follow-up, alongside various image-guided procedures, especially in patients with lung cancer. Accurate lung segmentation from whole-body CT scans is an initial, yet extremely important step in such procedures. Therefore, fast and robust (against low-quality data) segmentation techniques are being actively developed. In this paper, we propose a new real-time algorithm for segmenting lungs from the entire body CT scans. Our method benefits from both 2D and 3D analysis of CT images, coupled with several fast pruning strategies to remove false-positive tissue areas, including trachea and bronchi. Also, we developed a new approach for separating lungs which exploits spatial analysis of lung candidates. Our algorithms were implemented in Adaptive Vision Studio (AVS)|a visual-programming software suite based on the data-ow paradigm. Although AVS is extensively used in machine-vision industrial applications (it is equipped with a range of highly optimized image-processing routines), we showed it can be easily utilized in general data analysis applications, including medical imaging. Experimental study performed on a benchmark dataset manually annotated by an experienced reader revealed that our algorithm is very fast (average processing time of an entire CT series is less than 1.5 seconds), and it is competitive against the state of the art, delivering high-quality and consistent results (DICE was above 0.97 for both lungs; 0.96 for the left and 0.95 for the right lung after separation). The quantitative analysis was backed up with thorough qualitative investigation (including 2D and 3D visualizations) and statistical tests.