Releases: dyollb/sitk-cli
Releases · dyollb/sitk-cli
Update release (PEP 604 support)
This update release fixes to #10. When using from __future__ import annotations, the main difference is that inspect.signature parameters use string annotations (forward declarations). These need to be detected and resolved.
- support optional arguments: Optional[sitk.Image])
- support PEP 604 annotations: sitk.Image | None
- add test for
from __future__ import annotations, test in Python 3.8, 3.9, 3.10, 3.11
v0.5.0
v0.2.0
sitk-cli 0.2.0 First public release
This small package provides some helper functions based on the inspect module to translate functions that use sitk.Image in the signature in to functions that can be run from the command line. Function arguments of type sitk.Image are translated to pathlib.Path arguments. If the return type is sitk.Image a keyword argument is added to specify an output file, so the returned image can be written to file.
Example signature translation:
def median_filter(input: sitk.Image, radius: int) -> sitk.Image:
passis converted by sitk_cli.make_cli to:
def median_filter(input: pathlib.Path, radius: int, output: pathlib.Path = None):
pass