antonioguj / bronchinet

Airway segmentation from chest CTs using deep Convolutional Neural Networks
MIT License
60 stars 25 forks source link

Dose anyone run the code successfully? #8

Open Lnan1615 opened 3 years ago

Lnan1615 commented 3 years ago

Prepare data: 1.Preprocess data: I don't know what operation my CT data needs, what the data format should be and what the final result is. 2.Compute bounding-boxes: This step requires two folders ‘Lungs' and 'Images'. Is this the result from the previous step? What is stored in them? 3.Prepare data: This step requires three folders, and a new folder called ’Airway' has been added. What are about these?

Dose anyone know about this?

Lnan1615 commented 3 years ago

I have browsed all the steps of data preprocessing. What do in_roimask_dir, in_2ndmask_dir, reference_dir,crop_boundboxes_file, rescale_factors_file and in_conreg_dim mean? Where did you get it?

Lnan1615 commented 3 years ago

After running the script: 'bash script_evalEXACT.sh', there exists some errors.

1 1 1 1

Does anyone know why?

antonioguj commented 3 years ago

Dear Lnan1615,

Thank you for your interest in using my code.

I apologize for the errors when running the script 'script_evalEXACT.sh' to run the provided models. These were due to an outdated version wrt to the scripts for computations therein. I have fixed the script in push it to the repo. You should be able to run successfully the script after pulling the last changes. But please let me know otherwise.

antonioguj commented 3 years ago

I answer your other questions below. I apologize that the documentation of the code was not clear to explain the use of the different scripts. I plan to update the documentation soon.

In the general case, you will have a data base folder with the following directories:

Images: with image data (in dicom or nifti format).
Airways: with the reference airway segmentations as ground-truth.
Lungs: with lung segmentations (used with the option to mask to the ROI: lungs).
CoarseAirways: with a segmentation of the coarse airways (trachea and main bronchi) (used for testing, to attach the trachea and main bronchi to the predicted segmentations).

(Please bear in mind the meaning of these folders for the answers below).

1.Preprocess data: I don't know what operation my CT data needs, what the data format should be and what the final result is.

This is used to apply preprocessing operations to the input images, if needed, such as cropping / rescaling, and independently from the other scripts to prepare the data. You can have a list of the available operations by typing "--help" after calling the script. For most cases no such preprocessing operations are needed, and you can skip this step.

2.Compute bounding-boxes: This step requires two folders ‘Lungs' and 'Images'. Is this the result from the previous step? What is stored in them?

This step is to compute the bounding-box coordinates around the ROI: the lung regions, used later on in the script "./prepareData.py". The output of this script is a .npy / .csv file with these coordinates for each input image. If you do not have lung segmentations available / do not want to mask your input images to the ROI: lungs, you can skip this step.

3.Prepare data: This step requires three folders, and a new folder called ’Airway' has been added. What are about these?

This script takes the input images / reference airway segmentations and computes the data for training (or testing), by applying different preprocessing steps (cropping / masking to ROI...) and anonimizing the images (renamed image01, 02...). This script is always needed as the scripts to run experiments for training / testing, take the data (images and ground-truth) with the format output by this script.

And in apply_operation_images.py, what do in_roimask_dir, in_2ndmask_dir, reference_dir, crop_boundboxes_file, rescale_factors_file and in_conreg_dim mean? Where did you get it?

The extra input arguments you mention are used for some of the available operations. E.g., "in_roimask_dir" needs the path for the ROI mask (typically lungs), when using the "masking" option; "crop_boundboxes_file" needs the path to the file storing the coordinates of the bounding boxes for each input image, when using the "crop" option, ... The different options available and inputs will need a better documentation that I will add soon.