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 details)
Built Distribution
File details
Details for the file sitk-cli-0.2.1.tar.gz
.
File metadata
- Download URL: sitk-cli-0.2.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3684d06b12be498579a7dd1bea48b39360353994279682c93937c00ae9c18ff6 |
|
MD5 | c461d153c8b9aed94da444c0d5959f43 |
|
BLAKE2b-256 | 11244ba889d2e3495a9e221fb70248e8d560b521482f81c6d358a9e9353d98ad |
File details
Details for the file sitk_cli-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: sitk_cli-0.2.1-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.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6c801d9a32571d92c4487eb23ba0a4fc95d47d8a6bc66ea83e5e530dae87ed6 |
|
MD5 | 06f7360fafe2bd79210e1d4185f6807d |
|
BLAKE2b-256 | 5c795811130190c94e970e97d2321446e26b2922da7105ef419fa4a8206f9379 |