Skip to content

Commit

Permalink
Revert "fix None value use for channelwise normalization."
Browse files Browse the repository at this point in the history
This reverts commit 79b8df2.
  • Loading branch information
jens-maus committed Apr 15, 2024
1 parent cfeeb28 commit 41493f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pytorch3dunet/augment/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,22 +567,22 @@ def __call__(self, m):
# get min/max channelwise
axes = list(range(m.ndim))
axes = tuple(axes[1:])
if self.min_value is None:
if self.min_value is None or 'None' in self.min_value:
min_value = np.min(m, axis=axes, keepdims=True)

if self.max_value is None:
if self.max_value is None or 'None' in self.max_value:
max_value = np.max(m, axis=axes, keepdims=True)

# check if non None in self.min_value/self.max_value
# if present and if so copy value to min_value
if self.min_value is not None:
for i,v in enumerate(self.min_value):
if v is not None:
if v != 'None':
min_value[i] = v

if self.max_value is not None:
for i,v in enumerate(self.max_value):
if v is not None:
if v != 'None':
max_value[i] = v
else:
if self.min_value is None:
Expand Down

0 comments on commit 41493f5

Please sign in to comment.