Skip to content

Releases: dyollb/sitk-cli

Update release (PEP 604 support)

11 Aug 06:27
bc37b36

Choose a tag to compare

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

01 Jul 13:19

Choose a tag to compare

Update release:

  • #5 wrap sitk.Transform
  • #6 rewrite register_command as decorator
  • #8 handle Optional[sitk.Image] and Optional[sitk.Transform]
pip install sitk-cli==0.5.0

v0.2.0

03 Jul 16:25
cd5d02c

Choose a tag to compare

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:
    pass

is converted by sitk_cli.make_cli to:

def median_filter(input: pathlib.Path, radius: int, output: pathlib.Path = None):
    pass