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

Function paste

monai/transforms/utils.py:2215–2226  ·  view source on GitHub ↗

given a location (loc) and an original array (orig), paste a block array into it

(orig, block, loc)

Source from the content-addressed store, hash-verified

2213
2214
2215def paste(orig, block, loc):
2216 """
2217 given a location (loc) and an original array (orig), paste a block array into it
2218 """
2219 loc_zip = zip(loc, block.shape, orig)
2220 orig_slices, block_slices = zip(*map(paste_slices, loc_zip))
2221
2222 orig[:, orig_slices[0]] = block[block_slices[0]]
2223
2224 if orig.shape[0] == 1:
2225 orig = orig.squeeze()
2226 return orig
2227
2228
2229def squarepulse(sig, duty: float = 0.5):

Callers 3

__call__Method · 0.90
__call__Method · 0.90
__call__Method · 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…