-
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
monai.transforms.intensity.array.NormalizeIntensity bug when __call__ with channel_wise=True #8267
Comments
@Elferodie did you fix it? otherwise, can I take a look at it? |
No I didn’t fix it, you can take a look, thank you ! |
advcu987
added a commit
to advcu987/MONAI
that referenced
this issue
Jan 8, 2025
Fix channel-wise intensity normalization for integer type inputs. Signed-off-by: Adrian Voicu <[email protected]>
advcu987
added a commit
to advcu987/MONAI
that referenced
this issue
Jan 8, 2025
advcu987
added a commit
to advcu987/MONAI
that referenced
this issue
Jan 8, 2025
Fix channel-wise intensity normalization for integer type inputs. Signed-off-by: Adrian Voicu <[email protected]>
KumoLiu
pushed a commit
that referenced
this issue
Jan 20, 2025
Fixes #8267 . ### Description Fix channel-wise intensity normalization for integer type inputs. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [ ] Non-breaking change (fix or new feature that would not break existing functionality). - [x] Breaking change (fix or new feature that would cause existing functionality to change). - [x] New tests added to cover the changes. - [x] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [x] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: advcu987 <[email protected]> Signed-off-by: advcu <[email protected]> Co-authored-by: Eric Kerfoot <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
In the
__call__
method ofmonai.transforms.intensity.array.NormalizeIntensity
class, the conversion into torch.float32 performed in self._normalize line 911, is not taken into account whenchannel_wise = True
. The following code does not define a new variable img with the right type but it keeps the type of the original img variable. Therefore, if the original image was filled with int, the normalization will be performed on int and the normalization will fail.To Reproduce
Steps to reproduce the behavior:
Run commands
Expected behavior
The text was updated successfully, but these errors were encountered: