MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / get_arange_img

Function get_arange_img

tests/test_utils.py:434–441  ·  view source on GitHub ↗

Returns an image as a numpy array (complete with channel as dim 0) with contents that iterate like an arange.

(size, dtype=np.float32, offset=0)

Source from the content-addressed store, hash-verified

432
433
434def get_arange_img(size, dtype=np.float32, offset=0):
435 """
436 Returns an image as a numpy array (complete with channel as dim 0)
437 with contents that iterate like an arange.
438 """
439 n_elem = np.prod(size)
440 img = np.arange(offset, offset + n_elem, dtype=dtype).reshape(size)
441 return np.expand_dims(img, 0)
442
443
444class DistTestCase(unittest.TestCase):

Callers 3

test_iter_patchMethod · 0.90
test_resample.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…