Skip to main content

Wrap SimpleITK functions as command lines

Project description

Wrap SimpleITK functions as command lines

Build Actions Status License

Create simple command line interface from functions that use SimpleITK images as arguments or return type.

Example:

import SimpleITK as sitk
import typer

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__":
    app = typer.Typer()

    register_command(fill_holes_slice_by_slice, app)

    app()

Install from PyPI:

pip install sitk-cli

Project details


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.0.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

sitk_cli-0.2.0-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page