Skip to content

Commit 5d38069

Browse files
committed
update data_dir
1 parent 8501e4a commit 5d38069

26 files changed

Lines changed: 118 additions & 35 deletions

seg_nll/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 = ./data
6+
ground_truth_folder_root = ../../PyMIC_data/JSRT
77
segmentation_folder_root = result/unet_ce
88
evaluation_image_pair = config/data/jsrt_test_gt_seg.csv
99

seg_nll/JSRT/config/unet_ce.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 = ./data
6+
root_dir = ../../PyMIC_data/JSRT
77
train_csv = config/data/jsrt_train_mix.csv
88
valid_csv = config/data/jsrt_valid.csv
99
test_csv = config/data/jsrt_test.csv

seg_nll/JSRT/config/unet_clslsr.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 = ./data
6+
root_dir = ../../PyMIC_data/JSRT
77
train_csv = config/data/jsrt_train_mix_clslsr.csv
88
valid_csv = config/data/jsrt_valid.csv
99
test_csv = config/data/jsrt_test.csv

seg_nll/JSRT/config/unet_cot.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 = ./data
6+
root_dir = ../../PyMIC_data/JSRT
77
train_csv = config/data/jsrt_train_mix.csv
88
valid_csv = config/data/jsrt_valid.csv
99
test_csv = config/data/jsrt_test.csv

seg_nll/JSRT/config/unet_gce.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 = ./data
6+
root_dir = ../../PyMIC_data/JSRT
77
train_csv = config/data/jsrt_train_mix.csv
88
valid_csv = config/data/jsrt_valid.csv
99
test_csv = config/data/jsrt_test.csv
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
[dataset]
2+
# tensor type (float or double)
3+
tensor_type = float
4+
5+
task_type = seg
6+
root_dir = ../../PyMIC_data/JSRT
7+
train_csv = config/data/jsrt_train_mix.csv
8+
valid_csv = config/data/jsrt_valid.csv
9+
test_csv = config/data/jsrt_test.csv
10+
11+
train_batch_size = 8
12+
13+
# data transforms
14+
train_transform = [RandomCrop, RandomFlip, NormalizeWithMeanStd, LabelConvert, LabelToProbability]
15+
valid_transform = [NormalizeWithMeanStd, LabelConvert, LabelToProbability]
16+
test_transform = [NormalizeWithMeanStd]
17+
18+
RandomCrop_output_size = [224, 224]
19+
RandomCrop_foreground_focus = False
20+
RandomCrop_foreground_ratio = None
21+
Randomcrop_mask_label = None
22+
23+
RandomFlip_flip_depth = False
24+
RandomFlip_flip_height = True
25+
RandomFlip_flip_width = True
26+
27+
NormalizeWithMeanStd_channels = [0]
28+
29+
LabelConvert_source_list = [0, 255]
30+
LabelConvert_target_list = [0, 1]
31+
32+
[network]
33+
# this section gives parameters for network
34+
# the keys may be different for different networks
35+
36+
# type of network
37+
net_type = UNet2D
38+
39+
# number of class, required for segmentation task
40+
class_num = 2
41+
in_chns = 1
42+
feature_chns = [16, 32, 64, 128, 256]
43+
dropout = [0, 0, 0.3, 0.4, 0.5]
44+
bilinear = False
45+
deep_supervise= False
46+
47+
[training]
48+
# list of gpus
49+
gpus = [0]
50+
51+
loss_type = NoiseRobustDiceLoss
52+
NoiseRobustDiceLoss_gamma = 1.5
53+
54+
# for optimizers
55+
optimizer = Adam
56+
learning_rate = 1e-3
57+
momentum = 0.9
58+
weight_decay = 1e-5
59+
60+
# for lr schedular
61+
lr_scheduler = ReduceLROnPlateau
62+
lr_gamma = 0.5
63+
ReduceLROnPlateau_patience = 2000
64+
65+
ckpt_save_dir = model/unet_nrdice
66+
67+
# start iter
68+
iter_start = 0
69+
iter_max = 10000
70+
iter_valid = 100
71+
iter_save = [10000]
72+
73+
[testing]
74+
# list of gpus
75+
gpus = [0]
76+
77+
# checkpoint mode can be [0-latest, 1-best, 2-specified]
78+
ckpt_mode = 0
79+
output_dir = result/unet_nrdice
80+
81+
# convert the label of prediction output
82+
label_source = [0, 1]
83+
label_target = [0, 255]

seg_nll/JSRT/config/unet_trinet.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 = ./data
6+
root_dir = ../../PyMIC_data/JSRT
77
train_csv = config/data/jsrt_train_mix.csv
88
valid_csv = config/data/jsrt_valid.csv
99
test_csv = config/data/jsrt_test.csv

seg_nll/JSRT/noise_simulate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def add_random_nosie_to_label(label, r_range):
6060

6161
def debug():
6262
# for debug
63-
image_name = "/home/disk2t/projects/PyMIC_project/PyMIC_data/JSRT/label/JPCLN003.png"
63+
image_name = "../../PyMIC_data/JSRT/label/JPCLN003.png"
6464
img = Image.open(image_name)
6565
lab = np.asarray(img)
6666
lab_max = lab.max()
@@ -119,4 +119,4 @@ def generate_noise(data_root, radius_range):
119119
clean_ratio = 0.05
120120
radius_range = (6, 12)
121121
select_clean_samples(clean_ratio)
122-
generate_noise("./data", radius_range)
122+
generate_noise("../../PyMIC_data/JSRT", radius_range)

seg_ssl/ACDC/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Currently, the following semi-supervised methods are implemented:
2020

2121

2222
## Data
23-
The [ACDC][ACDC_link] (Automatic Cardiac Diagnosis Challenge) dataset is used in this demo. It contains 200 short-axis cardiac cine MR images of 100 patients, and the classes for segmentation are: Right Ventricle (RV), Myocardiym (Myo) and Left Ventricle (LV). The images are available in `PyMIC_data/ACDC/preprocess`, where we have normalized the intensity to [0, 1]. You can download `PyMIC_data` from .... The images are split at patient level into 70%, 10% and 20% for training, validation and testing, respectively (see `config/data` for details).
23+
The [ACDC][ACDC_link] (Automatic Cardiac Diagnosis Challenge) dataset is used in this demo. It contains 200 short-axis cardiac cine MR images of 100 patients, and the classes for segmentation are: Right Ventricle (RV), Myocardiym (Myo) and Left Ventricle (LV). The images are available in `PyMIC_data/ACDC/preprocess`, where we have normalized the intensity to [0, 1]. The images are split at patient level into 70%, 10% and 20% for training, validation and testing, respectively (see `config/data` for details).
2424

2525
In the training set, we have randomly selected 14 images of 7 patients as annotated images and the other 126 images as unannotated images. See `random_split_train.py`.
2626

@@ -30,12 +30,12 @@ In the training set, we have randomly selected 14 images of 7 patients as annota
3030
In this demo, we experiment with five methods: EM, UAMT, UPRC, CCT and CPS, and they are compared with the baseline of learning from annotated images. All these methods use UNet2D as the backbone network.
3131

3232
### Baseline Method
33-
The baseline method uses the 14 annotated cases for training. The batch size is 4, and the patch size is 6x192x192. Therefore, indeed there are 16 2D slices in each batch. See `config/unet2d_baseline.cfg` for details about the configuration. You need to set `root_dir` to your own `PyMIC_data/ACDC/preprocess`. The dataset configuration is:
33+
The baseline method uses the 14 annotated cases for training. The batch size is 4, and the patch size is 6x192x192. Therefore, indeed there are 16 2D slices in each batch. See `config/unet2d_baseline.cfg` for details about the configuration. The dataset configuration is:
3434

3535
```bash
3636
tensor_type = float
3737
task_type = seg
38-
root_dir = /home/disk2t/projects/PyMIC_project/PyMIC_data/ACDC/preprocess/
38+
root_dir = ../../PyMIC_data/ACDC/preprocess/
3939
train_csv = config/data/image_train_r10_lab.csv
4040
valid_csv = config/data/image_valid.csv
4141
test_csv = config/data/image_test.csv
@@ -268,7 +268,7 @@ Use `pymic_eval_seg config/evaluation.cfg` for quantitative evaluation of the se
268268
metric = dice
269269
label_list = [1,2,3]
270270
organ_name = heart
271-
ground_truth_folder_root = /home/disk2t/projects/PyMIC_project/PyMIC_data/ACDC/preprocess
271+
ground_truth_folder_root = ../../PyMIC_data/ACDC/preprocess
272272
segmentation_folder_root = ./result/unet2d_baseline
273273
evaluation_image_pair = ./config/data/image_test_gt_seg.csv
274274
```

seg_ssl/ACDC/config/evaluation.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ metric = dice
33
label_list = [1,2,3]
44
organ_name = heart
55

6-
ground_truth_folder_root = /home/disk2t/projects/PyMIC_project/PyMIC_data/ACDC/preprocess
7-
segmentation_folder_root = result/unet2d_mt
6+
ground_truth_folder_root = ../../PyMIC_data/ACDC/preprocess
7+
segmentation_folder_root = result/unet2d_cps
88
evaluation_image_pair = config/data/image_test_gt_seg.csv
99

0 commit comments

Comments
 (0)