Skip to content

Commit 321454c

Browse files
authored
[DLMED] add missing return (#2857)
Signed-off-by: Nic Ma <[email protected]>
1 parent f99ebda commit 321454c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

monai/transforms/intensity/array.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,24 +1699,24 @@ def randomize(self, img_size: Sequence[int]) -> None:
16991699

17001700
def __call__(self, img: np.ndarray):
17011701
self.randomize(img.shape[1:])
1702+
ret = img
17021703
if self._do_transform:
17031704
fill_value = (img.min(), img.max()) if self.fill_value is None else self.fill_value
17041705

17051706
if self.dropout_holes:
17061707
for h in self.hole_coords:
17071708
if isinstance(fill_value, (tuple, list)):
1708-
img[h] = self.R.uniform(fill_value[0], fill_value[1], size=img[h].shape)
1709+
ret[h] = self.R.uniform(fill_value[0], fill_value[1], size=img[h].shape)
17091710
else:
1710-
img[h] = fill_value
1711-
return img
1711+
ret[h] = fill_value
17121712
else:
17131713
if isinstance(fill_value, (tuple, list)):
17141714
ret = self.R.uniform(fill_value[0], fill_value[1], size=img.shape).astype(img.dtype)
17151715
else:
17161716
ret = np.full_like(img, fill_value)
17171717
for h in self.hole_coords:
17181718
ret[h] = img[h]
1719-
return ret
1719+
return ret
17201720

17211721

17221722
class HistogramNormalize(Transform):

0 commit comments

Comments
 (0)