Skip to main content

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.

Metadata

Release files for E-Cut 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for E-Cut 0.2.0
File Size Uploaded
e_cut-0.2.0.tar.gz 2.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for E-Cut 0.2.0
File Interpreter ABI Platform
E_Cut-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.3 MB

Release files / e_cut-0.2.0.tar.gz

Download URL e_cut-0.2.0.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
3647908afdcf658676631180ae71e898539a81b6f096ff714561fc11fa8090d2
BLAKE2b-256 checksum
How to use checksums
d4fd6f61a3c35b33ad50dfe033e1c2d2ffb52e5f1310730ffd4a679dd8a4b6a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / E_Cut-0.2.0-py3-none-any.whl

Download URL E_Cut-0.2.0-py3-none-any.whl
Size 42.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b283c0ea9ac4d1f17d9e4b1bfa7b2029053a1d41cd6bae24209f9acfeb62a52
BLAKE2b-256 checksum
How to use checksums
79b7787e4e1580f9183f93958ab9c4c24d53ca4fe08bf8d359256da36f75ac19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page