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

Method inverse

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

Source from the content-addressed store, hash-verified

941 return cropped
942
943 def inverse(self, img: MetaTensor) -> MetaTensor:
944 transform = self.get_most_recent_transform(img)
945 # we moved the padding info in the forward, so put it back for the inverse
946 pad_info = transform[TraceKeys.EXTRA_INFO].pop("pad_info")
947 img.applied_operations.append(pad_info)
948 # first inverse the padder
949 inv = self.padder.inverse(img)
950 # and then inverse the cropper (self)
951 return super().inverse(inv)
952
953
954class RandWeightedCrop(Randomizable, TraceableTransform, LazyTransform, MultiSampleTrait):

Callers 2

test_valueMethod · 0.95

Calls 4

popMethod · 0.80
appendMethod · 0.45
inverseMethod · 0.45

Tested by 2

test_valueMethod · 0.76