You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: generation/maisi/README.md
+54-2Lines changed: 54 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -287,13 +287,65 @@ torchrun \
287
287
```
288
288
Please also check [maisi_train_controlnet_tutorial.ipynb](./maisi_train_controlnet_tutorial.ipynb) for more details about data preparation and training parameters.
289
289
290
-
### 4. License
290
+
### 4. FID Score Computation
291
+
292
+
We provide the `compute_fid_2-5d_ct.py` script that calculates the Frechet Inception Distance (FID) between two 3D medical datasets (e.g., **real** vs. **synthetic** images). It uses a **2.5D** feature-extraction approach across three orthogonal planes (XY, YZ, ZX) and leverages **distributed GPU processing** (via PyTorch’s `torch.distributed` and NCCL) for efficient, large-scale computations.
293
+
294
+
#### Key Features
295
+
296
+
-**Distributed Processing**
297
+
Scales to multiple GPUs and larger datasets by splitting the workload across devices.
298
+
299
+
-**2.5D Feature Extraction**
300
+
Uses a slice-based technique, applying a 2D model across all slices in each dimension.
301
+
302
+
-**Flexible Preprocessing**
303
+
Supports optional center-cropping, padding, and resampling to target shapes or voxel spacings.
304
+
305
+
#### Usage Example
306
+
307
+
Suppose your **real** dataset root is `path/to/real_images`, and you have a `real_filelist.txt` that lists filenames line by line, such as:
308
+
```
309
+
case001.nii.gz
310
+
case002.nii.gz
311
+
case003.nii.gz
312
+
```
313
+
You also have a **synthetic** dataset in `path/to/synth_images` with a corresponding `synth_filelist.txt`. You can run the script as follows:
2. Load each `.nii.gz` file from your specified `real_filelist` and `synth_filelist`.
337
+
3. Apply 2.5D feature extraction across the XY, YZ, and ZX planes.
338
+
4. Compute FID to compare **real** vs. **synthetic** feature distributions.
339
+
340
+
For more details, see the in-code docstring in [`compute_fid_2-5d_ct.py`](./scripts/compute_fid_2-5d_ct.py) or consult our documentation for a deeper dive into function arguments and the underlying implementation.
341
+
342
+
### 5. License
291
343
292
344
The code is released under Apache 2.0 License.
293
345
294
346
The model weight is released under [NSCLv1 License](./LICENSE.weights).
295
347
296
-
### 5. Questions and Bugs
348
+
### 6. Questions and Bugs
297
349
298
350
- For questions relating to the use of MONAI, please use our [Discussions tab](https://github.com/Project-MONAI/MONAI/discussions) on the main repository of MONAI.
299
351
- For bugs relating to MONAI functionality, please create an issue on the [main repository](https://github.com/Project-MONAI/MONAI/issues).
0 commit comments