Skip to main content

A package based on traditional segmentation algorithms used to segment a fly retina images.

Project description

CS410_FlyEM

This repository hosts the segmentation pipeline to segment fly retina images using traditional segmentation algorithms.

Authors

Package Installation

Install this python package by executing the following command.

  pip install flyem_segmentation_pipeline

If the above command throws any error, please run the following command and install the dependency packages individually.

pip install flyem_segmentation_pipeling --no-deps

Required Python packages

All the above-mentioned packages are required to use this package, but due to the version issues with numpy and mahotas, during installation only matplotlib and scikit-image are installed; numpy and mahotas has to be installed separately.

Package Description

Anyone can use this package to perform various computer vision algorithms to segment the fly retina images.

The package followed MVC(Model-View-Controller) design pattern.

All the functionalities can be used by importing them using the following command.

from segmentationMVC.controller import ImageController

Functions

ImageController.read(): reads an image from the given path.

ImageController.normalize(): returns an normalized image of the input image to [0, 255].

ImageController.center_crop(): crops an image to a default size of (512, 512).

ImageController.smooth(): smoothens the image using Gaussian filter.

ImageController.threshold(): applies thresholding of an input image.

ImageController.binary_mask(): creates an binary mask of the image.

ImageController.display(): display the image.

Sample Usage

The below sample code reads an image from the input path.

from segmentationMVC.controller import ImageController
image_data = ImageController.read("..")

Output:

input image

The below sample code normalized the input image.

from segmentationMVC.controller import ImageController
normalized_data = ImageController.normalize(image_data)

Output:

normalized image

The below sample code crops the input image.

from segmentationMVC.controller import ImageController
crop_data = ImageController.normalize(normalized_data)

Output:

crop image

The below sample code smoothens the input image.

from segmentationMVC.controller import ImageController
smoothed_data = ImageController.smooth(crop_data)

Output:

smoothens image

To get the complete segmented image, the following will serve as an example.

from segmentationMVC.controller import ImageController

image_data = ImageController.read("..")

normalized_data = ImageController.normalize(image_data)

crop_data = ImageController.normalize(normalized_data)

smoothed_data = ImageController.smooth(crop_data)

threshold_data = ImageController.threshold(smoothed_data, threshold_value=73)
labeled_data, nr_count = ImageController.label(threshold_data)
selected_labeled_data = ImageController.select_regions(labeled_data, region_size=1500)
binary_mask_data = ImageController.binary_mask(selected_labeled_data)
closed_binary_mask_data = ImageController.close_binary_mask(binary_mask_data)
segmented_image = ImageController.binary_image(closed_binary_mask_data)

The variable segmented_image in the above sample code stores the result of the segmented image.

Output:

output image

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

flyem_segmentation_pipeline-1.3.2.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file flyem_segmentation_pipeline-1.3.2.tar.gz.

File metadata

File hashes

Hashes for flyem_segmentation_pipeline-1.3.2.tar.gz
Algorithm Hash digest
SHA256 c945500d411be6e062c664a4176fd9a2607005950ac8cc87ab5810f268a3f96a
MD5 c2de98a3a4882818d5910f55567e3a0e
BLAKE2b-256 0dd0e2b8edfc024b82815e62d98883c0cc47318707c169dea418c3f85a96f7b5

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