Skip to content

utility function to look up a method against a set of supported methods #2630

@wyli

Description

@wyli

Is your feature request related to a problem? Please describe.
porting utility from niftynet:
https://github.com/NifTK/NiftyNet/blob/935bf4334cd00fa9f9d50f6a95ddcbfdde4031e0/niftynet/utilities/util_common.py#L249-L256

def look_up_operations(type_str, supported):

    """
    This function validates the ``type_str`` against the supported set.
    if ``supported`` is a ``set``, returns ``type_str``
    if ``supported`` is a ``dict``, return ``supported[type_str]``
    else:
    raise an error possibly with a guess of the closest match.
    """

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions