Currently, there does not exist reliable MV treatment or protocols in critical care to treat acute respiratory diseases, and thus no proven way to optimise care to minimise the mortality, length of stay or cost. The overall approach of this research is to improve protocols by using appropriate computer models that take into account the essential lung mechanics. The aim of this research is to create an automated algorithm for tracking the boundary of individual or groups of alveoli, and to convert this into a pressure volume curve for three different types of alveoli. A technique called in vivo microscopy has been developed by Schiller et al which visualizes the inflation and deflation of individual alveoli in a surfactant deactivation model of lung injury in pigs. Three different types of alveoli were tracked using data from Schiller et al, type I, II and III. These types correspond to healthy alveoli, non-collapsing but partially diseased alveoli, and fully collapsing diseased alveoli respectively. The boundaries of all the alveoli that were tracked, compared well visually to the movies. Pressure versus Area curves were derived for both inflation and deflation, they captured the expected physiological behaviour, and were qualitatively similar to the quasi-static pressure area curves derived in Schiller et al, Quantitative differences are due to the dynamic effects of ventilation which were not investigated in Schiller et al.