Skip to main content

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 PyPI version Python versions tested License
Platforms Tested on Linux Tested on macOS Tested on Windows
Development Build status Quality Gate status Code coverage Documentation status
Reference Citation DOI link Zenodo DOI

Main classes

Access to morphological data from the source code is provided through the classes Tree, Node, Morph, and SWC:

  • Tree for recursive tree data structure
  • Node for morphology data storage
  • Morph for neuron morphology representation
  • SWC for 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:

  • check tests morphology reconstruction for structural consistency
  • convert converts morphology to compliant SWC format
  • find locates single nodes in the reconstruction
  • measure calculates morphometric features
  • modify manipulates morphology reconstruction
  • render displays 3D model of the reconstruction
  • repair corrects reconstruction errors
  • view shows 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.7
  • matplotlib
  • numpy
  • PyOpenGL optional, enables swc render command

For testing and documentation, treem requires additional development packages with third-party support:

  • sphinx with napoleon and programoutput extensions
  • sphinx-rtd-theme
  • pytest with optional pytest-cov plugin
  • coverage

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)

Source distribution for treem 1.2.0
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)

Table of built distributions (wheels) for treem 1.2.0
File Interpreter ABI Platform Actions
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 log

Release 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 log

Security 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.

Select from 2 files

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 log

A 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.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files Full provenance

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