-
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
auto3dseg analyzer incorrectly computes size of images, rounds to integers #7222
Comments
Hi @jpsacha, thanks for the reporting. Is there a reason why we need to force the conversion to int when calculating sizemm? |
closing as inactive |
Was this issue fixed? The problem is still there. |
Hi @jpsacha , thanks for reopening this thread and the follow up. It seems this line is causing the problem: MONAI/monai/auto3dseg/analyzer.py Line 259 in 8fa6931
Hi @myron , is there any concern to using floating point number here? |
I see, let's change it to be in float. |
Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
Fixes #7222 ### Description remove int convert here. https://github.com/Project-MONAI/MONAI/blob/8fa6931b14ba9617a595fff1d396ac44cc82e207/monai/auto3dseg/analyzer.py#L259 ### 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: YunLiu <55491388+KumoLiu@users.noreply.github.com>
Fixes Project-MONAI#7222 ### Description remove int convert here. https://github.com/Project-MONAI/MONAI/blob/8fa6931b14ba9617a595fff1d396ac44cc82e207/monai/auto3dseg/analyzer.py#L259 ### 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: YunLiu <55491388+KumoLiu@users.noreply.github.com> Signed-off-by: Mark Graham <markgraham539@gmail.com>
Fixes Project-MONAI#7222 ### Description remove int convert here. https://github.com/Project-MONAI/MONAI/blob/8fa6931b14ba9617a595fff1d396ac44cc82e207/monai/auto3dseg/analyzer.py#L259 ### 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: YunLiu <55491388+KumoLiu@users.noreply.github.com> Signed-off-by: Juan Pablo de la Cruz Gutiérrez <juampatronics@gmail.com>
Fixes Project-MONAI#7222 ### Description remove int convert here. https://github.com/Project-MONAI/MONAI/blob/8fa6931b14ba9617a595fff1d396ac44cc82e207/monai/auto3dseg/analyzer.py#L259 ### 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: YunLiu <55491388+KumoLiu@users.noreply.github.com> Signed-off-by: Yu0610 <612410030@alum.ccu.edu.tw>
Describe the bug
The
auto3dseg
analyzer
when computing sizes of images is converting the size in mm to integers. For small images, like OCT, that can results in image size of [0, 0, 0] and issues in code that is using the results produced by theanalyzer
.The incorrect code is here:
https://github.com/Project-MONAI/MONAI/blame/782c1e616312612c9f25bf4a33986ace67f7851e/monai/auto3dseg/analyzer.py#L259
To Reproduce
Consider an OCT image with spacing
[0.001, 0.001, 0.001]
and shape[308, 250, 256]
. The correct image size in mm should be[0.308, 0.250, 0.256]
. This can be reproduced with synthetic data too.Steps to reproduce the behavior:
jupyter
notebooks/auto3dseg/notebooks/auto3dseg_hello_world.ipynb
The error is a consequence of
image_size_mm
being incorrectly calculated as [0,0,0]Expected behavior
image_size_mm
should be computed correctly for pixel sizes that are a fraction of a mm (like 0.001). Notebook should execute without errorsEnvironment
Ensuring you use the relevant python executable, please paste the output of:
Additional context
The reported problem is happening when using a real world 3D data from an OCT instrument, but can be easily reproduced using synthetic data as illustrated above.
The text was updated successfully, but these errors were encountered: