Skip to content

This package provides seamless integration of pre-trained image segmentation models from Ilastik into Python workflows.

License

Notifications You must be signed in to change notification settings

titouanlegourrierec/EasIlastik

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LE GOURRIEREC Titouan LinkedIn Mail

EasIlastik

A package to facilitate the use of image segmentation model trained on Ilastik in Python
Explore the docs »
Report a bug · Request Feature

PyPI Version Downloads Code Style: Black License

Table of Contents
  1. About The Project 📖
  2. Getting Started
  3. Usage
  4. License
  5. Contact
  6. Acknowledgments

About The Project

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.

(back to top)

Built With

  • Python
  • OpenCV
  • Shell Script

(back to top)

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.

(back to top)

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

(back to top)

License

Distributed under the GNU License like the Ilastik software. See LICENSE for more information.

(back to top)

Contact

LE GOURRIEREC Titouan - [email protected]

Repository Link: https://github.com/titouanlegourrierec/EasIlastik
Pypi Link : https://pypi.org/project/EasIlastik/

(back to top)

Acknowledgments

(back to top)

About

This package provides seamless integration of pre-trained image segmentation models from Ilastik into Python workflows.

Topics

Resources

License

Stars

Watchers

Forks

Languages