MCPcopy Index your code
hub / github.com/Project-MONAI/MONAI / rescale_instance_array

Function rescale_instance_array

monai/transforms/utils.py:263–273  ·  view source on GitHub ↗

Rescale each array slice along the first dimension of `arr` independently.

(
    arr: np.ndarray, minv: float | None = 0.0, maxv: float | None = 1.0, dtype: DtypeLike = np.float32
)

Source from the content-addressed store, hash-verified

261
262
263def rescale_instance_array(
264 arr: np.ndarray, minv: float | None = 0.0, maxv: float | None = 1.0, dtype: DtypeLike = np.float32
265) -> np.ndarray:
266 """
267 Rescale each array slice along the first dimension of `arr` independently.
268 """
269 out: np.ndarray = np.zeros(arr.shape, dtype or arr.dtype)
270 for i in range(arr.shape[0]):
271 out[i] = rescale_array(arr[i], minv, maxv, dtype)
272
273 return out
274
275
276def rescale_array_int_max(arr: np.ndarray, dtype: DtypeLike = np.uint16) -> np.ndarray:

Callers

nothing calls this directly

Calls 1

rescale_arrayFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…