Thoracoscopy can be used as a biopsy procedure in the case where the diagnosis of cancer has not yet been made. In certain circumstances, it can also be used to remove the cancer.