Inclusion Criteria:  Signed the informed consent. Affected by pulmonary or mediastinal pathology. Who have required thoracic surgery.  Exclusion Criteria:  Patients with pacemakers. Diseases with chronic need for analgesic drug. History of drug addiction. Patients who do not require hospital readmission after surgery.