Skip to main content

Wrap SimpleITK functions as command lines

Project description

Wrap SimpleITK functions as command lines

Build Actions Status License PyPI version

Create simple command line interface from functions that use SimpleITK images (and transforms) 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


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.3.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

sitk_cli-0.3.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file sitk-cli-0.3.0.tar.gz.

File metadata

  • Download URL: sitk-cli-0.3.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for sitk-cli-0.3.0.tar.gz
Algorithm Hash digest
SHA256 753847d8b1fa09c732cc365623b678994541b9ef6553e62d026420674a8af945
MD5 c07487b03b6f2b5fddc47753094197c1
BLAKE2b-256 b033a6d11b79853adccca0ccdb4febc18372d9f3d1a5e2c9914a707b5b6dbf7f

See more details on using hashes here.

File details

Details for the file sitk_cli-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: sitk_cli-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for sitk_cli-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 636dab45dbb14d2fb0261f7d1adad95c56d5958f7ad9b1fb3bbb768c49225cf1
MD5 5bc48c9a2d27373825e1fd85d195351c
BLAKE2b-256 f79ec64a11b6d2bfaeb2a07f474b43405e3d79f85ee9a38211ff7c7de3c31ffd

See more details on using hashes here.

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