Skip to main content

Enhanced G-Cut algorithm on automated segmentation of interweaving neurons

Project description

Ensemble-Cut

Based on G-Cut, I add more metrics, such as for angle and radius. The graph cut is no long based on topological trees, but a highly interconnected network.

Installation

$ pip install E-Cut

Usage

Construct an ECut class object to run the workflow.

from ecut.graph_cut import ECut
from ecut.swc_handler import parse_swc, write_swc

# NOTE: the node numbering of this tree should be SORTED, and starts from ZERO.
tree = parse_swc('filepath.swc')
e = ECut(tree, [0, 100])    # 0 and 100 are the IDs of somata
e.run()
trees = e.export_swc()
write_swc(trees[100], 'outpath_100.swc')

You can customize the metrics to modify the optimization parameters.

...

from ecut.graph_metrics import EnsembleMetric

metric = EnsembleMetric(gof_weight=2, angle_weight=0.5)
e = ECut(tree, [0, 100], metric=metric)

...

You can even subclass ECut and EnsembleMetric to create your own optimization workflow or introduce more metrics into it.

Comparison with G-Cut

E-Cut is enhanced with superior features based on G-Cut.

First, it introduces angle and radius metrics. To make them compatible with the GOF probability, I replaced the shortest path searching with minimum spanning tree, so that all comparisons are performed locally (we take average GOF along the neurite path).

Second, it can handle more complexed topological errors. In the following case, I construct a pseudo neuron with 2 types of common topological errors to compare their performance.

pseudo

In this example, G-Cut is unable to fix the breakup between neurites (a tip node that is very close to another branch). On the other hand, E-Cut considers all such cases within a distance threshold by building up a fully interconnected network of neurites.

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

e_cut-0.2.0.tar.gz (2.3 MB view hashes)

Uploaded Source

Built Distribution

E_Cut-0.2.0-py3-none-any.whl (42.8 kB view hashes)

Uploaded Python 3

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