Skip to content

Commit a415465

Browse files
authored
Update monai spleen example and monai_nvflare [skip ci] (#1083)
* update error message * update setup; add example summary stats * update monai section of root readme * fix typo * increase rc version * increase rc version
1 parent 88329e2 commit a415465

File tree

10 files changed

+1255
-150
lines changed

10 files changed

+1255
-150
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ pip install nvflare
6060
The results, for all features of all datasets at all sites as well as global aggregates, can be visualized via the visualization utility in the notebook.
6161

6262
* [MONAI Integration](<https://github.com/NVIDIA/NVFlare/tree/main/integration/monai/README.md>)
63-
In 2.2 release, we provided two implementations by leveraging Monai "bundle"
64-
* Monai [ClientAlgo](https://docs.monai.io/en/latest/fl.html#monai.fl.client.ClientAlgo) Integration -- enable running MONAI bundles directly in a federated setting using NVFLARE
65-
* Monai [Statistics](https://docs.monai.io/en/latest/fl.html#monai.fl.client.ClientAlgoStats) Integration -- through NVFLARE Federated Statistics we can generate, compare and visualize all client's data statistics generated from Monai summary statistics
63+
In 2.2 release, we provided two implementations by leveraging MONAI [Bundle](https://docs.monai.io/en/latest/bundle_intro.html).
64+
* MONAI [ClientAlgo](https://docs.monai.io/en/latest/fl.html#monai.fl.client.ClientAlgo) Integration -- enable running MONAI bundles directly in a federated setting using NVFLARE
65+
* MONAI [ClientAlgoStats](https://docs.monai.io/en/latest/fl.html#monai.fl.client.ClientAlgoStats) Integration -- through NVFLARE Federated Statistics we can generate, compare and visualize all clients' data statistics generated from MONAI summary statistics
6666

6767
* Tools and Production Support
6868
* [Improved POC command](https://nvflare.readthedocs.io/en/main/user_guide/poc_command.html)
@@ -74,7 +74,7 @@ pip install nvflare
7474
### Migrations tips
7575

7676
To migrate from releases prior to 2.2.1, here are few notes that might help
77-
[migrate to 2.2.1](docs/release_notes/2.2.1/migration_notes.md)
77+
[migrate to 2.2.1](docs/release_notes/2.2.1/migration_notes.md).
7878

7979

8080
## Third party license

integration/monai/examples/spleen_ct_segmentation/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ To avoid caching the data for training (which will not be executed during the st
9595
```
9696
nvflare simulator job_stats --workspace /tmp/nvflare/sim_spleen_ct_seg --threads 2 --n_clients 2 --gpu 0,1
9797
```
98-
The results will be placed in the workspace directory under `simulate_job/statistics/image_statistics.json`.
98+
The histogram results will be placed in the workspace directory under `simulate_job/statistics/image_statistics.json`.
99+
Additional summary statistics, like average image shapes and spacings, computed by MONAI are placed under `simulate_job/app_server/`.
100+
See [stats_demo/simulate_job/app_server](./stats_demo/simulate_job/app_server) for examples.
99101

100102
For an end-to-end demo, including visualization of the gathered statistics, start a Jupyter Lab with `stats_demo`
101103
```
28 KB
Loading
46 KB
Loading

integration/monai/examples/spleen_ct_segmentation/stats_demo/simulate_job/app_server/site-1_data_stats.yaml

Lines changed: 550 additions & 0 deletions
Large diffs are not rendered by default.

integration/monai/examples/spleen_ct_segmentation/stats_demo/simulate_job/app_server/site-2_data_stats.yaml

Lines changed: 550 additions & 0 deletions
Large diffs are not rendered by default.

integration/monai/examples/spleen_ct_segmentation/stats_demo/stats_demo.ipynb

Lines changed: 141 additions & 139 deletions
Large diffs are not rendered by default.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
tensorboard
21
tqdm
32
nibabel
43
fire
54
pytorch-ignite>=0.4.10
65
monai>=1.0.1rc3
7-
nvflare>=2.2.1rc8
8-
monai_nvflare>=0.2.0
6+
nvflare>=2.2.1rc9
7+
monai_nvflare>=0.2.1rc1
8+
tensorboard

integration/monai/monai_nvflare/client_algo_statistics.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ def pre_run(
103103
raise ValueError(
104104
f"There are more returned histograms ({n_hists}) for dataset "
105105
f"{dataset_name} than provided feature names. "
106-
f"Please use '*' to define the histogram bins and range for all features."
106+
f"Please use '*' to define the histogram bins and range for all features "
107+
f"or provide histograms bins and range for each feature."
107108
)
108109
if fn == "*":
109110
fn = "Intensity"
@@ -117,7 +118,7 @@ def pre_run(
117118
if len(self.feature_names) != n_hists:
118119
raise ValueError(
119120
f"Given length of feature names {self.feature_names} ({len(self.feature_names)}) "
120-
f"do not match returned histograms ({n_hists})!"
121+
f"do not match returned histograms ({n_hists}) for dataset {dataset_name}!"
121122
)
122123
for _hist_fn, _histo in zip(self.feature_names, hist_list):
123124
self.histograms[dataset_name][_hist_fn] = _histo

integration/monai/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@
5555
long_description=long_description,
5656
long_description_content_type="text/markdown",
5757
python_requires=">=3.7,<3.9",
58-
install_requires=["monai==1.0.1rc3", "nvflare>=2.2.1rc8"],
58+
install_requires=["monai>=1.0.1rc4", "nvflare>=2.2.1rc9"],
5959
)

0 commit comments

Comments
 (0)