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

Class Identity

monai/transforms/utility/array.py:117–130  ·  view source on GitHub ↗

Do nothing to the data. As the output value is same as input, it can be used as a testing tool to verify the transform chain, Compose or transform adaptor, etc.

Source from the content-addressed store, hash-verified

115
116
117class Identity(Transform):
118 """
119 Do nothing to the data.
120 As the output value is same as input, it can be used as a testing tool to verify the transform chain,
121 Compose or transform adaptor, etc.
122 """
123
124 backend = [TransformBackends.TORCH, TransformBackends.NUMPY]
125
126 def __call__(self, img: NdarrayOrTensor) -> NdarrayOrTensor:
127 """
128 Apply the transform to `img`.
129 """
130 return img
131
132
133class RandIdentity(RandomizableTrait):

Callers 4

__init__Method · 0.90
test_identityMethod · 0.90

Calls

no outgoing calls

Tested by 3

test_identityMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…