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

Method inverse

monai/transforms/croppad/array.py:427–434  ·  view source on GitHub ↗
(self, img: MetaTensor)

Source from the content-addressed store, hash-verified

425 return crop_func(img_t, tuple(slices_), lazy_, self.get_transform_info())
426
427 def inverse(self, img: MetaTensor) -> MetaTensor:
428 transform = self.pop_transform(img)
429 cropped = transform[TraceKeys.EXTRA_INFO]["cropped"]
430 # the amount we pad is equal to the amount we cropped in each direction
431 inverse_transform = BorderPad(cropped)
432 # Apply inverse transform
433 with inverse_transform.trace_transform(False):
434 return inverse_transform(img) # type: ignore
435
436
437class SpatialCrop(Crop):

Callers

nothing calls this directly

Calls 3

BorderPadClass · 0.85
pop_transformMethod · 0.80
trace_transformMethod · 0.45

Tested by

no test coverage detected