Project-MONAI / tutorials

MONAI Tutorials
https://monai.io/started.html
Apache License 2.0
1.74k stars 662 forks source link

MAISI inference utility functions used for notebook #1741

Closed Can-Zhao closed 1 month ago

Can-Zhao commented 1 month ago

Fixes # .

Description

MAISI inference utility functions.

Checks

review-notebook-app[bot] commented 1 month ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

KumoLiu commented 1 month ago

I'd like to outline a few points for consideration regarding the current PR:

  1. Should we present this tutorial using a bundle format, or would a Jupyter notebook or script be more user-friendly for understanding?
  2. It seems advantageous to generalize the erode3d, dilate3d, and closing functions and incorporate them into the MONAI core.
  3. The augmentation methods added appear to diverge from the typical MONAI transform conventions. Would it be possible to align these new transforms with the established format? https://github.com/Project-MONAI/tutorials/blob/1c41a0cdaffe88665beffeb19eae282ef1fd4b74/generative/maisi/scripts/augmentation.py#L368
  4. I recommend removing the hard-coded label classes from functions when the operations are applicable across various datasets, promoting flexibility. https://github.com/Project-MONAI/tutorials/blob/1c41a0cdaffe88665beffeb19eae282ef1fd4b74/generative/maisi/scripts/find_masks.py#L43
  5. Could we refactor the larger function into a set of smaller, reusable functions for clarity and ease of understanding? I appreciate your attention to these suggestions and look forward to the refinements. Thanks!
dongyang0122 commented 1 month ago

I would suggest to change from "generative" to "generation" or "3d_generation" following folder structures of other tutorials. @Can-Zhao

Can-Zhao commented 1 month ago

@guopengf Hi Pengfei, I saw you have defined a few plotting funcs in mask_augmentation_example.ipynb Do you think it would be better to move them to somewhere like scripts/utils_plot.py? So all the other notebooks can use those plot funcs. Thank you!

mingxin-zheng commented 1 month ago

The CI premerge-notebooks indicates the installation of monai-generative fails

mingxin-zheng commented 1 month ago

To fix the imports and CI errors, I would suggest to do the following:

!python -c "import monai" || pip install -q "monai-weekly[nibabel, tqdm]"
!python -c "import generative; print(generative.__version__)" || pip install -q "monai-generative"
Can-Zhao commented 1 month ago

To fix the imports and CI errors, I would suggest to do the following:

!python -c "import monai" || pip install -q "monai-weekly[nibabel, tqdm]"
!python -c "import generative; print(generative.__version__)" || pip install -q "monai-generative"

Thank. It seems CI error still exists...I was wondering if you have any idea on how to fix it. Thank you!

mingxin-zheng commented 1 month ago

It is very likely that the CI environment (V100 16G) cannot support the notebook testing because: