Update README.md
Browse files
README.md
CHANGED
|
@@ -5,6 +5,30 @@ This repository provides the nnUNet v2 checkpoint for multi-organ lesion segment
|
|
| 5 |
|
| 6 |
The model was trained on a large-scale multi-center CT dataset with expert-annotated lesion masks across multiple organs (liver, pancreas, kidney, colon).
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
|
| 10 |
## 1. Installation
|
|
@@ -17,53 +41,40 @@ pip install -e .
|
|
| 17 |
|
| 18 |
## 2. Inference
|
| 19 |
|
| 20 |
-
#### 2.1 Convert dataset (CT scans) to nnUNet naming format and
|
| 21 |
|
|
|
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
|
|
|
| 24 |
|
| 25 |
```bash
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
βββ BDMAP_0000002_0000.nii.gz
|
| 29 |
-
βββ ...
|
| 30 |
```
|
| 31 |
|
| 32 |
-
|
| 33 |
|
| 34 |
```bash
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
-
|
| 38 |
-
|
| 39 |
|
| 40 |
-
|
| 41 |
-
tar -xzvf xzhou120_DAP_Atlas_Mini.tar.gz
|
| 42 |
|
| 43 |
-
|
| 44 |
-
tar -xzvf xzhou120_Lymph_node.tar.gz
|
| 45 |
-
```
|
| 46 |
|
| 47 |
-
##### 2.2 Run the inference process (Single GPU with GPUID=0)
|
| 48 |
-
```bash
|
| 49 |
-
GPUID=1
|
| 50 |
-
ID_TO_PROCESS=batch1.csv
|
| 51 |
-
CHECKPOINT_TO_RUN=checkpoint1.csv
|
| 52 |
-
bash run.sh $GPUID $ID_TO_PROCESS $CHECKPOINT_TO_RUN
|
| 53 |
```
|
| 54 |
|
| 55 |
-
When completed, the results will be save as
|
| 56 |
|
| 57 |
-
|
| 58 |
-
$INTERMEDIATE_OUTPUT
|
| 59 |
-
BDMAP_00000001/
|
| 60 |
-
βββ predictions/
|
| 61 |
-
β βββ V-Rad_0001/
|
| 62 |
-
β β βββ class_0001.nii.gz
|
| 63 |
-
β β βββ class_0003.nii.gz
|
| 64 |
-
β β βββ class_0004.nii.gz
|
| 65 |
-
β βββ V-Rad_0002/
|
| 66 |
-
β β βββ class_0002.nii.gz
|
| 67 |
-
β β βββ class_0004.nii.gz
|
| 68 |
-
β β βββ class_0005.nii.gz
|
| 69 |
-
```
|
|
|
|
| 5 |
|
| 6 |
The model was trained on a large-scale multi-center CT dataset with expert-annotated lesion masks across multiple organs (liver, pancreas, kidney, colon).
|
| 7 |
|
| 8 |
+
## Label Definitions
|
| 9 |
+
```bash
|
| 10 |
+
"labels": {
|
| 11 |
+
"background": 0,
|
| 12 |
+
"liver_segment_1": 1,
|
| 13 |
+
"liver_segment_2": 2,
|
| 14 |
+
"liver_segment_3": 3,
|
| 15 |
+
"liver_segment_4": 4,
|
| 16 |
+
"liver_segment_5": 5,
|
| 17 |
+
"liver_segment_6": 6,
|
| 18 |
+
"liver_segment_7": 7,
|
| 19 |
+
"liver_segment_8": 8,
|
| 20 |
+
"pancreas_head": 9,
|
| 21 |
+
"pancreas_body": 10,
|
| 22 |
+
"pancreas_tail": 11,
|
| 23 |
+
"kidney_left": 12,
|
| 24 |
+
"kidney_right": 13,
|
| 25 |
+
"colon": 14,
|
| 26 |
+
"liver_lesion": 15,
|
| 27 |
+
"pancreatic_lesion": 16,
|
| 28 |
+
"kidney_lesion": 17,
|
| 29 |
+
"colon_lesion": 18
|
| 30 |
+
}
|
| 31 |
+
```
|
| 32 |
|
| 33 |
|
| 34 |
## 1. Installation
|
|
|
|
| 41 |
|
| 42 |
## 2. Inference
|
| 43 |
|
|
|
|
| 44 |
|
| 45 |
+
#### 2.1 Create a folder (e.g., nnUNet_eval) and rename all .ct files and put them in it.
|
| 46 |
|
| 47 |
+
```bash
|
| 48 |
+
nnUNet_eval/
|
| 49 |
+
βββ Dataset1351/
|
| 50 |
+
βββ imagesTs/
|
| 51 |
+
βββ ct001_0000.nii.gz
|
| 52 |
+
βββ ct002_0000.nii.gz
|
| 53 |
+
```
|
| 54 |
|
| 55 |
+
#### 2.2 Place the checkpoint into
|
| 56 |
|
| 57 |
```bash
|
| 58 |
+
nnUNet_results/
|
| 59 |
+
βββ Dataset1351/nnUNetTrainer__nnUNetResEncUNetLPlans__3d_fullres/fold_all/
|
|
|
|
|
|
|
| 60 |
```
|
| 61 |
|
| 62 |
+
#### 2.3 Run inference
|
| 63 |
|
| 64 |
```bash
|
| 65 |
+
export nnUNet_N_proc_DA=36
|
| 66 |
+
export nnUNet_results="./nnUNet_results"
|
| 67 |
+
export nnUNet_predictions="./nnUNet_predictions"
|
| 68 |
+
export nnUNet_eval="./nnUNet_eval"
|
| 69 |
|
| 70 |
+
GPU_ID=0
|
| 71 |
+
DATASET=1351
|
| 72 |
|
| 73 |
+
TRAINER=nnUNetTrainer
|
|
|
|
| 74 |
|
| 75 |
+
CUDA_VISIBLE_DEVICES=$GPU_ID nnUNetv2_predict -d $DATASET -i $nnUNet_eval/ -o $nnUNet_predictions/ -tr $TRAINER -d $DATASET -c 3d_fullres -f all -p nnUNetResEncUNetLPlans --continue_prediction
|
|
|
|
|
|
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
```
|
| 78 |
|
|
|
|
| 79 |
|
| 80 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|