tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

MAISI inference utility functions

Open Can-Zhao opened this issue 1 year ago • 3 comments

Fixes # .

Description

MAISI inference utility functions

Checks

  • [ ] Avoid including large-size files in the PR.
  • [ ] Clean up long text outputs from code cells in the notebook.
  • [ ] For security purposes, please check the contents and remove any sensitive info such as user names and private key.
  • [ ] Ensure (1) hyperlinks and markdown anchors are working (2) use relative paths for tutorial repo files (3) put figure and graphs in the ./figure folder
  • [ ] Notebook runs automatically ./runner.sh -t <path to .ipynb file>

Can-Zhao avatar Jun 27 '24 17:06 Can-Zhao

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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!

KumoLiu avatar Jul 01 '24 10:07 KumoLiu

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

dongyang0122 avatar Jul 01 '24 14:07 dongyang0122

@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!

Can-Zhao avatar Jul 08 '24 02:07 Can-Zhao

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

mingxin-zheng avatar Jul 08 '24 07:07 mingxin-zheng

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"

mingxin-zheng avatar Jul 08 '24 11:07 mingxin-zheng

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!

Can-Zhao avatar Jul 09 '24 00:07 Can-Zhao

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

  • insufficient memory
  • lack of supported xformers version compiled for the right arch

mingxin-zheng avatar Jul 09 '24 15:07 mingxin-zheng