Skip to content

deangeckt/swc_editor

Repository files navigation

logo192 Neuron SWC editor

Online Editor

This is a free and simple online editor for morphological neuron SWC files.

It includes: visualize, edit, import and export SWC files in 2D, and export a transparent PNG image. The exported files can later be used in simulation software such as Neuron.

Morphological files can be found at: https://neuromorpho.org/.

Working with skeletons:

To use a skeleton from MICrONS, which can be loaded via skeleton_plot or Meshparty run:

Loading the skeleton:

import skeleton_plot.skel_io as skel_io
skel_path = "s3://bossdb-open-data/iarpa_microns/minnie/minnie65/skeletons/v661/skeletons/"  
nucleus_id = 256609
segment_id = 864691135404231406
skel_filename = f"{segment_id}_{nucleus_id}.swc"
sk = skel_io.read_skeleton(skel_path, skel_filename)

Exporting the skeleton to SWC:

import numpy as np
sk.export_to_swc(
    f'{nucleus_id}.swc',
    node_labels=sk.vertex_properties["compartment"],
    radius=np.array(sk.vertex_properties["radius"]),
    xyz_scaling=1
)

Demo

In this short video I demonstrate how to upload an SWC file, navigate around using the mouse (zoom via wheel), and remove a branch from the axon.

demo.mp4