A severe variant of pulmonary hypertension is a chronic thromboembolic pulmonary hypertension (CTEPH) that is related to acute pulmonary embolism. The current diagnosis is performed by visual analysis of single-photon emission computed tomography (SPECT) ventilation and perfusion images. A mismatch of defects that are only present in the perfusion image confirms the diagnosis. This paper presents an algorithm to diagnose CTEPH based on the comparison of the volumes extracted from both SPECT images. The algorithm is designed to also differentiate between cases of CTEPH and a respiratory pathology. A total sample of 32 patients is divided into three groups depending on their diagnosis: (1) reference, (2) CTEPH and (3) respiratory pathology. Reference values of segmentation thresholds and lung volumes are obtained from the first group. These volumes are then used to define thresholds for the classification of the cases of groups two and three. After segmenting the SPECT images and calculating the volumes of ventilation and perfusion, these thresholds are applied to determine the diagnosis. Even though a small patient database is used, the results indicate that the quantitative analysis of SPECT ventilation and perfusion images can support the diagnosis of CTEPH