treem – Neuron Morphology Processing Tool
The treem module (pronounced "trim") provides data structures and
command-line tools for accessing and manipulating digital reconstructions
of neuronal morphology in the Stockley-Wheal-Cannon (SWC) format.
| Release |
|
| Platforms |
|
| Development |
|
| Reference |
|
Main classes
Access to morphological data from the source code is provided through the
classes Tree, Node, Morph, and SWC:
Treefor recursive tree data structureNodefor morphology data storageMorphfor neuron morphology representationSWCfor definitions of the data format
Commands
Common operations with SWC files can be performed using the swc
command-line tool:
swc <command> [options] file
Alternatively:
swc <command> file [file ...] [options]
List of swc commands:
checktests morphology reconstruction for structural consistencyconvertconverts morphology to compliant SWC formatfindlocates single nodes in the reconstructionmeasurecalculates morphometric featuresmodifymanipulates morphology reconstructionrenderdisplays 3D model of the reconstructionrepaircorrects reconstruction errorsviewshows morphology structure
Installation
Install the latest stable release:
pip install treem
Install a development version:
pip install git+https://github.com/a1eko/treem
See also pip documentation for installation alternatives.
Dependencies
The treem module has minimal runtime dependencies:
python>= 3.7matplotlibnumpyPyOpenGLoptional, enablesswc rendercommand
For testing and documentation, treem requires additional development packages with
third-party support:
sphinxwithnapoleonandprogramoutputextensionssphinx-rtd-themepytestwith optionalpytest-covplugincoverage
Documentation
Documentation is available online at Read the Docs.
Citation
-
Hjorth JJJ, Hellgren Kotaleski J, Kozlov A (2021) Predicting Synaptic Connectivity for Large-Scale Microcircuit Simulations Using Snudda. Neuroinformatics, 19(4):685-701. DOI: 10.1007/s12021-021-09531-w.
-
Kozlov AK (2021) Treem - neuron morphology processing tool. Zenodo. DOI: 10.5281/zenodo.4890844.
Funding
Horizon 2020 Framework Programme (785907, HBP SGA2); Horizon 2020 Framework Programme (945539, HBP SGA3); Vetenskapsrådet (VR-M-2017-02806, VR-M-2020-01652); Swedish e-science Research Center (SeRC); KTH Digital Futures.
We acknowledge the use of Fenix Infrastructure resources, which are partially funded from the European Union's Horizon 2020 research and innovation programme through the ICEI project under the grant agreement No. 800858.
The computations and testing were enabled by resources provided by the National Academic Infrastructure for Supercomputing in Sweden (NAISS), partially funded by the Swedish Research Council through grant agreement no. 2022-06725, also by the Swedish National Infrastructure for Computing (SNIC) at PDC KTH partially funded by the Swedish Research Council through grant agreement no. 2018-05973.
Metadata
Release files for treem 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| treem-1.2.0.tar.gz | 2.6 MB | With provenance | Details for treem-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| treem-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for treem-1.2.0-py3-none-any.whl |
Total release size: 2.7 MB
Release files / treem-1.2.0.tar.gz
| Download URL | treem-1.2.0.tar.gz |
|---|---|
| Size | 2.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c3d8e0310a33334b0e4c3d5591f078d422f7d18ddc3abc20972c84adc095f922
|
|
BLAKE2b-256 checksum How to use checksums |
74ee1c89f6fe4611ed8f57588c2563879527bf4c05fa724ee654977290ef9883
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2025.
Transparency logRelease files / treem-1.2.0-py3-none-any.whl
| Download URL | treem-1.2.0-py3-none-any.whl |
|---|---|
| Size | 49.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b0a629cbd1141a78ceaa8064509ebaffd75f85e81086309bd3a018144e1dd785
|
|
BLAKE2b-256 checksum How to use checksums |
c54fca98af9a4808f0d0445c18bcb0c23098adc6b4c37ace87c6b5e1a140ede9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2025.
Transparency logSecurity for treem 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for treem-1.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.