All consecutive adults with either CTEPH referred to our center for endarterectomy, or PAH referred for lung transplantation, will be included, aiming for 150 CTEPH and 50 PAH. After inclusion, patients will undergo assessment of right heart dimensions and function by cardiac magnetic resonance imaging (MRI, including 4-Dimensions blood flow sequences) and 2D and 3D trans-thoracic echocardiography (TTE), as well as immune panel analysis. All patients will undergo as part of routine care right heart catheterization within a week after TTE and MRI imaging. On the day of surgery, pulmonary pressure will be measured by right heart catheterization monitoring (as part of routine care) in order to estimate the drop of pressure and to adjust for the extent of endarterectomy for patients with CTEPH. TTE will also be performed on the day of surgery if possible. At 7 days post-endarterectomy or transplant, clinical outcomes will be collected and peripheral blood will be collected. Patients will be prospectively follow-up for 6 months. Death, need for reintervention, duration of vasopressor after surgery and number, duration and cause of readmission will be recorded. At 6 months after surgery, all survivors will undergo the same biological sampling, as well as an 4D MRI and a 2D and 3D TTE. Data of right heart catheterization at 6 months (as part of routine care) will be collected as well.