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

Method first_key

monai/transforms/transform.py:491–500  ·  view source on GitHub ↗

Get the first available key of `self.keys` in the input `data` dictionary. If no available key, return an empty tuple `()`. Args: data: data that the transform will be applied to.

(self, data: dict[Hashable, Any])

Source from the content-addressed store, hash-verified

489 )
490
491 def first_key(self, data: dict[Hashable, Any]):
492 """
493 Get the first available key of `self.keys` in the input `data` dictionary.
494 If no available key, return an empty tuple `()`.
495
496 Args:
497 data: data that the transform will be applied to.
498
499 """
500 return first(self.key_iterator(data), ())

Callers 15

__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80

Calls 2

key_iteratorMethod · 0.95
firstFunction · 0.90

Tested by

no test coverage detected