-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set image_only=True
in LoadImaged
#5007
Comments
I think we'd definitely like to see this happen, we didn't do this initially as there may be lots of other places in the codebase that assume load image to return the meta data, or at least to return multiple objects. This sort of thing would be trickier to pick up on:
With the old default, It would be hard to find and replace all instances of this in our own code base and tutorials, and we have have no way of correcting code that users have written, nor any way of printing a deprecated error/warning if users were using the default and the default has changed. |
changing the default will avoid this confusion #5097. |
…adImage` (#5900) Signed-off-by: Wenqi Li <[email protected]> Fixes #5007 ### Description adds a warning message about changing the default value of `image_only=False` to `image=True` in 1.3 example warnings: ```py Python 3.8.13 (default, Mar 28 2022, 06:16:26) [Clang 12.0.0 ] :: Anaconda, Inc. on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from monai.transforms import LoadImage; LoadImage() monai.transforms.io.array LoadImage.__init__:image_only: Current default value of argument `image_only=False` has been deprecated since 1.1. It will be changed to `image_only=True` in version 1.3. <monai.transforms.io.array.LoadImage object at 0x7fe9e807fe20> >>> from monai.transforms import LoadImageD; LoadImageD('test') monai.transforms.io.dictionary LoadImaged.__init__:image_only: Current default value of argument `image_only=False` has been deprecated since 1.1. It will be changed to `image_only=True` in version 1.3. <monai.transforms.io.dictionary.LoadImaged object at 0x7fe9c97062b0> >>> ``` ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Wenqi Li <[email protected]> Signed-off-by: Wenqi Li <[email protected]> Co-authored-by: Eric Kerfoot <[email protected]>
Is your feature request related to a problem? Please describe.
Since 0.9.1, we recommend that users use
MataTensor
, which will save the meta information in metatensor by default. The default value ofimage_only
inLoadImage
is False, which will return image and header dict.MONAI/monai/transforms/io/dictionary.py
Line 79 in 09993fa
For some transforms that have deprecated the meta_dict which meta information in meta_dict will not be updated in time. Such as
Spacingd
MONAI/monai/transforms/spatial/dictionary.py
Lines 326 to 327 in 09993fa
Describe the solution you'd like
Set
image_only=True
inLoadImaged
andLoadImage
The text was updated successfully, but these errors were encountered: