Wrap SimpleITK functions as command lines
Project description
Wrap SimpleITK functions as command lines
Create simple command line interface from functions that use SimpleITK images as arguments or return type.
Install from PyPI:
pip install sitk-cli
Example:
import SimpleITK as sitk
import typer
from sitk-cli import make_cli
def fill_holes_slice_by_slice(mask: sitk.Image) -> sitk.Image:
mask = mask != 0
output = sitk.Image(mask.GetSize(), mask.GetPixelID())
output.CopyInformation(mask)
for k in range(mask.GetSize()[2]):
output[:, :, k] = sitk.BinaryFillhole(mask[:, :, k], fullyConnected=False)
return output
if __name__ == "__main__":
typer.run(make_cli(fill_holes_slice_by_slice))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sitk-cli-0.2.1.tar.gz
(3.5 kB
view hashes)