Skip to content
Discussion options

You must be logged in to vote

you can also consider monai.transforms.apply_transform, something like:

result = apply_transform(transforms, data, map_items=True)

def apply_transform(
transform: Callable[..., ReturnType],
data: Any,
map_items: bool = True,
unpack_items: bool = False,
log_stats: bool | str = False,
lazy: bool | None = False,
overrides: dict | None = None,
) -> list[ReturnType] | ReturnType:
"""
Transform `data` with `transform`.
If `data` is a list or tuple and `map_data` is True, each item of `data` will be transformed
and this method returns a list of outcomes.

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@KumoLiu
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by guillaume-troadec
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants