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

Method inverse

monai/transforms/spatial/dictionary.py:1196–1207  ·  view source on GitHub ↗
(self, data: Mapping[Hashable, NdarrayOrTensor])

Source from the content-addressed store, hash-verified

1194 return d
1195
1196 def inverse(self, data: Mapping[Hashable, NdarrayOrTensor]) -> dict[Hashable, NdarrayOrTensor]:
1197 d = dict(data)
1198 for key in self.key_iterator(d):
1199 tr = self.pop_transform(d[key])
1200 if TraceKeys.EXTRA_INFO not in tr[TraceKeys.EXTRA_INFO]:
1201 continue
1202 do_resampling = tr[TraceKeys.EXTRA_INFO][TraceKeys.EXTRA_INFO]["do_resampling"]
1203 if do_resampling:
1204 d[key].applied_operations.append(tr[TraceKeys.EXTRA_INFO]) # type: ignore
1205 d[key] = self.rand_affine.inverse(d[key]) # type: ignore
1206
1207 return d
1208
1209
1210class Rand2DElasticd(RandomizableTransform, MapTransform):

Callers

nothing calls this directly

Calls 4

key_iteratorMethod · 0.80
pop_transformMethod · 0.80
appendMethod · 0.45
inverseMethod · 0.45

Tested by

no test coverage detected