Purpose behind optional imports #162
-
Hi, I am trying to build and operator to convert dicom series to nrrd and was trying to follow the logic behind scripting operators already implemented in the library. In I was wondering why Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Thanks for the question. optional_import is used both in MONAI and MONAI Deploy App SDK, so that the package themselves when built/published do not contain those dependent packages, e.g. an application is built to perform classic image processing from a DICOM study, no need to use PyTorch for inference, hence no need to force PyTorch package be in the App SDK. |
Beta Was this translation helpful? Give feedback.
-
@jpcenteno80 could you please confirm Ming's answer solved your question to close this discussion? Thanks! |
Beta Was this translation helpful? Give feedback.
Thanks for the question.
optional_import is used both in MONAI and MONAI Deploy App SDK, so that the package themselves when built/published do not contain those dependent packages, e.g. an application is built to perform classic image processing from a DICOM study, no need to use PyTorch for inference, hence no need to force PyTorch package be in the App SDK.