Skip to main content

Easy integration of Ilastik segmentation models in Python.

Project description


easilastik

Easy integration of Ilastik segmentation models in Python.

PyPI Version MIT License CI status Code Style: Ruff Type Checking: Ty

🌄 Overview

This package provides seamless integration of pre-trained image segmentation models from Ilastik into Python workflows, empowering users with efficient and intuitive image segmentation capabilities for diverse applications.

🚀 Getting Started

Prerequisites

  • Ilastik software: To train your own model for image segmentation, please download the Ilastik software tailored to your computer's operating system from: https://www.ilastik.org/download.

Train a model

  • To train your own model on Ilastik and properly adjust the different parameters, please refer to this documentation.

📦 Installation

To install easilastik, run the following command:

pip install easilastik

🛠️ Usage

For usage examples of this package, please refer to the Example Notebook.

Process a single image

EasIlastik.run_ilastik(input_path = "path/to/your/image.jpg", # The path of the image to process
                       model_path = "path/to/your/model.ilp",
                       result_base_path = "path/to/your/output/folder",
                       export_source = "Simple Segmentation",
                       output_format = "png")

run_ilastik_image

Process a folder of images

EasIlastik.run_ilastik(input_path = "path/to/input/folder", # The path of the folder to process
                       model_path = "path/to/your/model.ilp",
                       result_base_path = "path/to/your/output/folder",
                       export_source = "Simple Segmentation",
                       output_format = "png")

run_ilastik_folder

Show probabilities

EasIlastik.run_ilastik(input_path = "path/to/input/image",
                       model_path = "path/to/model.ilp",
                       result_base_path = "path/to/output/folder",
                       export_source="Probabilities", # Probabilities
                       output_format="hdf5") # hdf5 format

output_path = "path/to/output/image.h5"
image = EasIlastik.color_treshold_probabilities(output_path, threshold, below_threshold_color, channel_colors)

run_ilastik_probabilities

Run with probabilities

EasIlastik.run_ilastik_probabilities(input_path = "path/to/input/folder",
                                     model_path = "path/to/model.ilp",
                                     result_base_path = "path/to/output/folder",
                                     threshold = 70, # threshold for the probabilities
                                     below_threshold_color = [255, 0, 0], # color for the pixels below the threshold (red)
                                     channel_colors = [[63, 63, 63], [127, 127, 127], ...] # colors for the different channels
                                     )

run_ilastik_probabilities

⚖️ License

Elevatr is licensed under the GNU General Public License v3.0. This means that you are free to use, modify, and distribute this software, but any derivative works must also be licensed under the same terms. For more details, please refer to the LICENSE file.

back to top


GitHub @titouanlegourrierec  · Email titouanlegourrierec@icloud.com

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

easilastik-2.0.0.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easilastik-2.0.0-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file easilastik-2.0.0.tar.gz.

File metadata

  • Download URL: easilastik-2.0.0.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for easilastik-2.0.0.tar.gz
Algorithm Hash digest
SHA256 5eca031c6c9cbd695d7723c96640555d57229dfca9e92553a0dc3494c4f0fb95
MD5 79ffe7000063aa924aa456505f0bfd1e
BLAKE2b-256 348a7eb29c8fe12ad50950c45ba80a75c2f9e617537499ad2ea910f6c4b282ee

See more details on using hashes here.

File details

Details for the file easilastik-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: easilastik-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for easilastik-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f5b62783e383ec8a7d7799ad405a455c9207e0c02a42ba42c6616c4c4bb8da2
MD5 672b083ba8ced5401ab643c01685bc8b
BLAKE2b-256 7b5623d17abcbfadb537423865b42d59527f32f4ba01135f86d2196cf3506d69

See more details on using hashes here.

Supported by

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