prasb commited on
Commit
59c2e75
Β·
verified Β·
1 Parent(s): fc63cc0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +69 -0
README.md CHANGED
@@ -73,6 +73,75 @@ MICCAI 2025 <br/>
73
  Louis Blankemeier, Joseph P. Cohen, Ashwin Kumar, ..., Akshay S. Chaudhari<br/>
74
  *Stanford* <br/>
75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  # Citations
77
  If you use the code, data or methods in this repository, please cite:
78
 
 
73
  Louis Blankemeier, Joseph P. Cohen, Ashwin Kumar, ..., Akshay S. Chaudhari<br/>
74
  *Stanford* <br/>
75
 
76
+
77
+
78
+
79
+ # Inference
80
+
81
+ **0- Download and installation.**
82
+
83
+
84
+ <details>
85
+ <summary style="margin-left: 25px;">[Optional] Install Anaconda on Linux</summary>
86
+ <div style="margin-left: 25px;">
87
+
88
+ ```bash
89
+ wget https://repo.anaconda.com/archive/Anaconda3-2024.06-1-Linux-x86_64.sh
90
+ bash Anaconda3-2024.06-1-Linux-x86_64.sh -b -p ./anaconda3
91
+ ./anaconda3/bin/conda init
92
+ source ~/.bashrc
93
+ ```
94
+ </div>
95
+ </details>
96
+
97
+ ```
98
+ git clone https://github.com/MrGiovanni/R-Super
99
+ cd R-Super/rsuper_train
100
+ conda create -n rsuper python=3.10
101
+ conda activate rsuper
102
+ pip install -r requirements.txt
103
+ pip install -U "huggingface_hub[cli]"
104
+ hf download AbdomenAtlas/R-SuperPanTSMerlin --local-dir ./R-SuperPanTSMerlin
105
+ ```
106
+
107
+ **1- Pre-processing.** Prepare your dataset in the format below. You can use symlinks instead of copying your data.
108
+ <details>
109
+ <summary style="margin-left: 25px;">Dataset format.</summary>
110
+ <div style="margin-left: 25px;">
111
+
112
+ ```
113
+ /path/to/dataset/
114
+ β”œβ”€β”€ BDMAP_0000001
115
+ | └── ct.nii.gz
116
+ β”œβ”€β”€ BDMAP_0000002
117
+ | └── ct.nii.gz
118
+ ...
119
+ ```
120
+ </div>
121
+ </details>
122
+
123
+ **2- Inference.** The code below will inference, generating binary segmentation masks. To save probabilities, add the argument --save_probabilities or --save_probabilities_lesions (which saves only probabilities for lesions, not for organs). The optional argument --organ_mask_on_lesion will use organ segmentations (produced by the R-Super model itself, not ground-truth) to remove tumor predictions outside its organ.
124
+
125
+ ```bash
126
+ python predict_abdomenatlas.py --load R-SuperPanTSMerlin/merlin_pancreas_pants_release/fold_0_latest.pth --img_path /path/to/test/dataset/ --class_list R-SuperPanTSMerlin/labels_pants.yaml --save_path /path/to/inference/output/ --organ_mask_on_lesion
127
+ ```
128
+ <details>
129
+ <summary style="margin-left: 25px;"> Argument Details </summary>
130
+ <div style="margin-left: 25px;">
131
+
132
+ - load: path to the model checkpoint (fold_0_latest.pth)
133
+ - img_path: path to dataset
134
+ - class_list: a yaml file with the class names of your model
135
+ - save_path: path to output, where masks will be saved
136
+ - ids: this is an optional argument. By default, the code will predict on all cases in --img_path. If you pass ids, the code will only test with the CT scans indicated in ids. You can use this to separate a test set: --ids /path/to/test/set/ids.csv. The csv file must have a 'BDMAP ID' column with the ids of the test cases.
137
+
138
+ </details>
139
+
140
+ For more details, see https://github.com/MrGiovanni/R-Super/tree/main/rsuper_train#test
141
+
142
+
143
+
144
+
145
  # Citations
146
  If you use the code, data or methods in this repository, please cite:
147