|
a |
|
b/config/paths.py |
|
|
1 |
import os |
|
|
2 |
|
|
|
3 |
logs_folder = "logs" |
|
|
4 |
os.makedirs(logs_folder, exist_ok=True) |
|
|
5 |
|
|
|
6 |
base_dataset_dir = os.path.join("datasets","Task04_Hippocampus") |
|
|
7 |
train_images_folder = os.path.join(base_dataset_dir, "imagesTr") |
|
|
8 |
train_labels_folder = os.path.join(base_dataset_dir, "labelsTr") |
|
|
9 |
train_prediction_folder = os.path.join(base_dataset_dir, "predTr") |
|
|
10 |
train_images = os.listdir(train_images_folder) |
|
|
11 |
train_labels = os.listdir(train_labels_folder) |
|
|
12 |
|
|
|
13 |
train_images = [train_image for train_image in train_images |
|
|
14 |
if train_image.endswith(".nii.gz") and not train_image.startswith('.')] |
|
|
15 |
train_labels = [train_label for train_label in train_labels |
|
|
16 |
if train_label.endswith(".nii.gz") and not train_label.startswith('.')] |
|
|
17 |
test_images_folder = os.path.join(base_dataset_dir, "imagesTs") |
|
|
18 |
test_images = os.listdir(test_images_folder) |
|
|
19 |
test_prediction_folder = os.path.join(base_dataset_dir, "predTs") |
|
|
20 |
|
|
|
21 |
test_images = [test_image for test_image in test_images |
|
|
22 |
if test_image.endswith(".nii.gz") and not test_image.startswith('.')] |
|
|
23 |
|
|
|
24 |
labels_names = { |
|
|
25 |
"0": "background", |
|
|
26 |
"1": "Anterior", |
|
|
27 |
"2": "Posterior" |
|
|
28 |
} |
|
|
29 |
labels_names_list = [labels_names[el] for el in labels_names] |