Skip to content

Commit 54e89a3

Browse files
authored
Clarify the input maximum in the large-image rescale test
1 parent c672080 commit 54e89a3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/test_normalize.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,10 @@ def test_large_tensor_interior_quantile(self) -> None:
259259
def test_rescale_intensity_large_image(self) -> None:
260260
# Exceeds torch.quantile's 2**24-element limit; uses min/max endpoints.
261261
data = torch.zeros(1, 2**24 + 1, 1, 1, dtype=torch.float32)
262-
data[0, -1] = 4.0
262+
# A single non-zero voxel becomes the input maximum; everything else
263+
# is the minimum, so the output spans the full [0, 1] range.
264+
input_max = 4.0
265+
data[0, -1] = input_max
263266
image = tio.ScalarImage(data)
264267
transform = tio.RescaleIntensity(out_min=0.0, out_max=1.0, copy=False)
265268
result = transform(image)

0 commit comments

Comments
 (0)