Skip to content

Commit 8501e4a

Browse files
committed
update data dir
1 parent fa4f521 commit 8501e4a

15 files changed

Lines changed: 19 additions & 19 deletions

File tree

segmentation/JSRT/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
In this example, we use 2D U-Net to segment the lung from X-Ray images. First we edit the configuration file for training and testing. During training, we use tensorboard to observe the performance of the network at different iterations. We then apply the trained model to testing images and obtain quantitative evaluation results.
77

88
## Data and preprocessing
9-
1. Download the `PyMIC_data` and the images are saved in `PyMIC_data/JSRT`. The orginal dataset is available at the [JSRT website][jsrt_link]. It consists of 247 chest radiographs. We have preprocessed the images by resizing them to 256x256 and extracting the lung masks for the segmentation task. If interested, you can read `image_convert.py` for details of the preprocessing.
9+
1. The orginal dataset is available at the [JSRT website][jsrt_link]. It consists of 247 chest radiographs. We have preprocessed the images by resizing them to 256x256 and extracting the lung masks for the segmentation task. The images are available at `PyMIC_data/JSRT`. If interested, you can read `image_convert.py` for details of the preprocessing.
1010

11-
5. Set `JSRT_root` according to your computer in `write_csv_files.py` and run `python write_csv_files.py` to randomly split the 247 images into training (180 images), validation (20 images) and testing (47 images) sets. The output csv files are saved in `config`.
11+
5. Run `python write_csv_files.py` to randomly split the 247 images into training (180 images), validation (20 images) and testing (47 images) sets. The output csv files are saved in `config`.
1212

1313
[jsrt_link]:http://db.jsrt.or.jp/eng.php
1414

1515
## Training
16-
1. Edit `config/unet.cfg` by setting the value of `root_dir` as your `JSRT_root`. Then start to train by running:
16+
1. Start to train by running:
1717

1818
```bash
1919
pymic_run train config/unet.cfg

segmentation/JSRT/config/evaluation.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ metric = dice
33
label_list = [255]
44
organ_name = lung
55

6-
ground_truth_folder_root = /home/disk2t/projects/PyMIC_project/PyMIC_data/JSRT
6+
ground_truth_folder_root = ../../PyMIC_data/JSRT
77
segmentation_folder_root = result
88
evaluation_image_pair = ./config/jsrt_test_gt_seg.csv
99

segmentation/JSRT/config/unet.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
tensor_type = float
44

55
task_type = seg
6-
root_dir = /home/disk2t/projects/PyMIC_project/PyMIC_data/JSRT
6+
root_dir = ../../PyMIC_data/JSRT
77
train_csv = config/jsrt_train.csv
88
valid_csv = config/jsrt_valid.csv
99
test_csv = config/jsrt_test.csv

segmentation/JSRT/write_csv_files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def get_evaluation_image_pairs(test_csv, gt_seg_csv):
6868
if __name__ == "__main__":
6969
# create cvs file for JSRT dataset
7070
# edit JSRT_root based on your system
71-
JSRT_root = '/home/disk2t/projects/PyMIC_project/PyMIC_data/JSRT'
71+
JSRT_root = '../../PyMIC_data/JSRT'
7272
output_file = 'config/jsrt_all.csv'
7373
fields = ['image', 'label']
7474
create_csv_file(JSRT_root, output_file, fields)

segmentation/JSRT2/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ We also write a customized main function in `jsrt_net_run.py` so that we can com
1313
1. We use the same dataset as in the the `JSRT` example.
1414

1515
## Training
16-
1. Edit `config/mynet.cfg` by setting the value of `root_dir` as your `JSRT_root`, and start to train by running:
16+
1. Start to train by running:
1717

1818
```bash
1919
python net_run_jsrt.py train config/mynet.cfg

segmentation/JSRT2/config/evaluation.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ metric = dice
33
label_list = [255]
44
organ_name = lung
55

6-
ground_truth_folder_root = /home/disk2t/projects/PyMIC_project/PyMIC_data/JSRT
6+
ground_truth_folder_root = ../../PyMIC_data/JSRT
77
segmentation_folder_root = result
88
evaluation_image_pair = ../JSRT/config/jsrt_test_gt_seg.csv
99

segmentation/JSRT2/config/mynet.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
tensor_type = float
44

55
task_type = seg
6-
root_dir = /home/disk2t/projects/PyMIC_project/PyMIC_data/JSRT
6+
root_dir = ../../PyMIC_data/JSRT
77
train_csv = ../JSRT/config/jsrt_train.csv
88
valid_csv = ../JSRT/config/jsrt_valid.csv
99
test_csv = ../JSRT/config/jsrt_test.csv

segmentation/fetal_hc/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ In this example, we use 2D U-Net to segment the fetal brain from ultrasound imag
77

88
## Data and preprocessing
99
1. We use the [HC18][hc18_link] dataset for this example. The images are ready to use in `PyMIC_data/Fetal_HC`. There are 999 2D ultrasound images and their annotations in the training set. The original annotations are contours, and we have converted them into binary masks for segmentation. (The conversion code is in `get_ground_truth.py`)
10-
2. Set `HC_root` according to your computer in `write_csv_files.py` and run `python write_csv_files.py` to randomly split the official HC18 training set into our own training (780 images), validation (70 images) and testing (149 images) sets. The output csv files are saved in `config`.
10+
2. Run `python write_csv_files.py` to randomly split the official HC18 training set into our own training (780 images), validation (70 images) and testing (149 images) sets. The output csv files are saved in `config`.
1111

1212
[hc18_link]:https://hc18.grand-challenge.org/
1313

1414
## Training
15-
1. Edit `config/unet.cfg` by setting the value of `root_dir` as your `HC_root`. Then start to train by running:
15+
1. Start to train by running:
1616

1717
```bash
1818
pymic_run train config/unet.cfg

segmentation/fetal_hc/config/evaluation.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ metric = dice
33
label_list = [255]
44
organ_name = brain
55

6-
ground_truth_folder_root = /home/disk2t/projects/PyMIC_project/PyMIC_data/Fetal_HC
6+
ground_truth_folder_root = ../../PyMIC_data/Fetal_HC
77
segmentation_folder_root = result
88
evaluation_image_pair = ./config/fetal_hc_test_gt_seg.csv

segmentation/fetal_hc/config/unet.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
tensor_type = float
44

55
task_type = seg
6-
root_dir = /home/disk2t/projects/PyMIC_project/PyMIC_data/Fetal_HC
6+
root_dir = ../../PyMIC_data/Fetal_HC
77
train_csv = config/fetal_hc_train.csv
88
valid_csv = config/fetal_hc_valid.csv
99
test_csv = config/fetal_hc_test.csv

0 commit comments

Comments
 (0)