You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In the __call__ method of monai.transforms.intensity.array.NormalizeIntensity class, the conversion into torch.float32 performed in self._normalize line 911, is not taken into account when channel_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.
for i, d in enumerate(img):
img[i] = self._normalize( # type: ignore
d,
sub=self.subtrahend[i] if self.subtrahend is not None else None,
div=self.divisor[i] if self.divisor is not None else None,
)
To Reproduce
Steps to reproduce the behavior:
Run commands
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: