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 details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

Details for the file e_cut-0.2.0.tar.gz.

File metadata

  • Download URL: e_cut-0.2.0.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.9

File hashes

Hashes for e_cut-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3647908afdcf658676631180ae71e898539a81b6f096ff714561fc11fa8090d2
MD5 ec1bcb1f844d62c642153c0c627a260d
BLAKE2b-256 d4fd6f61a3c35b33ad50dfe033e1c2d2ffb52e5f1310730ffd4a679dd8a4b6a8

See more details on using hashes here.

File details

Details for the file E_Cut-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: E_Cut-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 42.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.9

File hashes

Hashes for E_Cut-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b283c0ea9ac4d1f17d9e4b1bfa7b2029053a1d41cd6bae24209f9acfeb62a52
MD5 3b1091069e7b96345f2dec91a058ed08
BLAKE2b-256 79b7787e4e1580f9183f93958ab9c4c24d53ca4fe08bf8d359256da36f75ac19

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