Skip to content

Commit 3e3aa3e

Browse files
update READMEs
1 parent cf1be83 commit 3e3aa3e

3 files changed

Lines changed: 68 additions & 56 deletions

File tree

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ A pre-built Docker image is available for download (see [website](https://bic-ma
121121
**Direct Python usage:**
122122

123123
```bash
124-
python src/baseline/model.py <input_dir> <output_ct.nii.gz>
124+
python src/baseline/predict.py <features_dir> <output_ct.nii.gz>
125125
# Example:
126-
python src/baseline/model.py data/sub-000/features/ results/sub-000/ct_pred.nii.gz
126+
python src/baseline/predict.py data/sub-000/features/ results/sub-000/ct_pred.nii.gz
127127
```
128128

129129
---
@@ -241,20 +241,28 @@ Five metrics compare predicted PET and CT outputs against the ground truth:
241241
| Organ Bias (MARE) | `organ_bias` | Mean absolute relative error of mean SUV in 8 organs: brain, liver, spleen, heart, pancreas, muscle, adipose, extremities | TotalSegmentator organ labels |
242242
| CT MAE | `ct_mae` | Mean absolute error of attenuation coefficients (μ at 511 keV) between predicted and ground-truth CT after HU→μ conversion | Body mask, excluding ±4 cm around liver|
243243

244-
**Run all metrics:**
244+
**Evaluate a single subject:**
245245

246246
```bash
247-
python src/evaluation/eval.py <subject_dir> <pred_pet.nii.gz> <pred_ct.nii.gz> -all
247+
python src/evaluation/eval_case.py \
248+
--subject_path <subject_dir> \
249+
--pred_pet <pred_pet.nii.gz> \
250+
--pred_ct <pred_ct.nii.gz>
248251
```
249252

250-
**Run a single metric:**
253+
`--pred_pet` and `--pred_ct` are both optional — omit either to skip PET or CT metrics.
254+
Note: Brain Outlier Score is a dataset-level metric and requires multiple subjects (see below).
255+
256+
**Evaluate a full dataset (matches challenge leaderboard):**
251257

252258
```bash
253-
python src/evaluation/eval.py <subject_dir> <pred_pet.nii.gz> <pred_ct.nii.gz> \
254-
-specific_metric <metric>
255-
# <metric>: whole_body_mae | brain_outlier | organ_bias | ct_mae
259+
python src/evaluation/eval_dataset.py \
260+
--dataset_path <dataset_dir> \
261+
--pred_dir <predictions_dir>
256262
```
257263

264+
`<predictions_dir>` must contain one sub-folder per subject, each with `ct.nii.gz` and `pet.nii.gz`.
265+
258266
---
259267

260268
## 📬 Submission

src/baseline/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ The baseline model has already been pretrained
1919
Run with Docker:
2020

2121
```bash
22-
docker run ghcr.io/bic-mac-challenge/baseline \
23-
--memory 120g \
22+
docker run --rm \
23+
--memory 120g \
2424
-v /path/to/sub-XXX/features:/data/features:ro \
2525
-v /path/to/output:/data/output \
26-
bic-mac-baseline
26+
ghcr.io/bic-mac-challenge/baseline
2727
```
2828

2929
Or without Docker:

src/evaluation/README.md

Lines changed: 49 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,20 @@ derived from CT after HU→μ conversion.
3838

3939
# Requirements
4040

41-
- Python **3.10+**
41+
- Python **3.12**
4242
- [`uv`](https://github.com/astral-sh/uv) for environment and
4343
dependency management
4444

4545
------------------------------------------------------------------------
4646

4747
# Installation
4848

49-
Clone the repository:
49+
Clone the repository and install dependencies:
5050

5151
``` bash
5252
git clone <repository_url>
5353
cd <repository_folder>
54-
```
55-
56-
Create and activate a virtual environment:
57-
58-
``` bash
59-
uv venv
60-
source .venv/bin/activate
61-
```
62-
63-
Install required dependencies:
64-
65-
``` bash
66-
uv pip install numpy nibabel
54+
uv sync
6755
```
6856

6957
------------------------------------------------------------------------
@@ -115,55 +103,72 @@ Both must:
115103

116104
# Running the Evaluation
117105

118-
Run the evaluation script with:
106+
There are two entry points: `eval_case.py` for a single subject and `eval_dataset.py` for a
107+
full dataset (this matches the challenge leaderboard computation, including the dataset-level
108+
Brain Outlier Score).
109+
110+
## Single subject
119111

120112
``` bash
121-
python eval.py --subject_path <subject_path> --pred_pet <pred_pet> --pred_ct <pred_ct> [-all | -specific_metric <metric_name>]
113+
python eval_case.py \
114+
--subject_path <subject_path> \
115+
--pred_pet <pred_pet.nii.gz> \
116+
--pred_ct <pred_ct.nii.gz>
122117
```
123118

124-
------------------------------------------------------------------------
119+
`--pred_pet` and `--pred_ct` are both optional — omit either to skip the corresponding metrics.
125120

126-
# Arguments
121+
Note: Brain Outlier Score is a dataset-level metric and is not computed by `eval_case.py`.
127122

128-
Argument Description
129-
-------------------- ---------------------------------
130-
`--subject_path` Path to the subject directory
131-
`--pred_pet` Path to the predicted PET NIfTI
132-
`--pred_ct` Path to the predicted CT NIfTI
133-
`-all` Run all evaluation metrics
134-
`-specific_metric` Run only a single metric
123+
## Full dataset
124+
125+
``` bash
126+
python eval_dataset.py \
127+
--dataset_path <dataset_path> \
128+
--pred_dir <predictions_dir>
129+
```
130+
131+
`<predictions_dir>` must contain one sub-folder per subject, each with `ct.nii.gz` and `pet.nii.gz`.
135132

136133
------------------------------------------------------------------------
137134

138-
# Example
135+
# Arguments
139136

140-
Run all metrics:
137+
## `eval_case.py`
141138

142-
``` bash
143-
python eval.py --subject_path /data/sub-000 --pred_pet /results/pred_pet.nii.gz --pred_ct /results/pred_ct.nii.gz -all
144-
```
139+
Argument Description
140+
-------------------- ---------------------------------
141+
`--subject_path` Path to the subject directory (must contain `ct-label/` and `pet-label/`)
142+
`--pred_pet` Path to the predicted PET NIfTI (optional)
143+
`--pred_ct` Path to the predicted CT NIfTI (optional)
145144

146-
Run only CT μ-MAE:
145+
## `eval_dataset.py`
147146

148-
``` bash
149-
python eval.py --subject_path /data/sub-000 --pred_pet /results/pred_pet.nii.gz --pred_ct /results/pred_ct.nii.gz -specific_metric ct_mae
150-
```
147+
Argument Description
148+
-------------------- -------------------------------------------------------
149+
`--dataset_path` Root directory containing subject folders with ground-truth labels
150+
`--pred_dir` Directory with one sub-folder per subject (each containing `ct.nii.gz` and `pet.nii.gz`)
151+
`--subjects` Optional explicit list of subject IDs (default: all sub-folders in pred_dir)
151152

152153
------------------------------------------------------------------------
153154

154-
# Available Metrics
155+
# Example
155156

156-
The following metrics can be executed individually:
157+
Evaluate a single subject:
157158

158-
whole_body_mae
159-
brain_outlier
160-
organ_bias
161-
ct_mae
159+
``` bash
160+
python eval_case.py \
161+
--subject_path /data/sub-000 \
162+
--pred_pet /results/sub-000/pet.nii.gz \
163+
--pred_ct /results/sub-000/ct.nii.gz
164+
```
162165

163-
Example:
166+
Evaluate a full dataset:
164167

165168
``` bash
166-
python eval.py --subject_path <subject_path> --pred_pet <pred_pet> --pred_ct <pred_ct> -specific_metric whole_body_mae
169+
python eval_dataset.py \
170+
--dataset_path /data/bic-mac/train \
171+
--pred_dir /results/my_method
167172
```
168173

169174
------------------------------------------------------------------------
@@ -174,9 +179,8 @@ python eval.py --subject_path <subject_path> --pred_pet <pred_pet> --pred_ct <pr
174179
Subject: sub-000
175180
----------------------------------------------------
176181
Whole-body SUV MAE : 0.124512
177-
Brain Outlier Score : 0.912341
178182
Organ Bias : 6.382100%
179-
CT μ-MAE : 0.000218
183+
CT MAE : 0.000218
180184
====================================================
181185

182186
------------------------------------------------------------------------

0 commit comments

Comments
 (0)