In [1]:
import morphopy
MorphoPy can preprocess standard .swc format and .imx files from Imaris/Filament Tracer.
Morph() object takes two argument: filepath and preprocess. By setting preprocess=True, MorphoPy will check and remove duplicate data points in data, if they exist, and also connect all the disconnected parts to one single neuronal tree, as it always happened in messy raw data. If you are sure your data is clean and don't need any preprocessing, you can turn it off. Noted, only swc is supported without preprocessing when preprocess=False.
A short summary of data quality will return when reading data.
In [2]:
m = morphopy.Morph(filepath='data/EC3-80604.CNG.swc', preprocess=True)
In [3]:
m.summarize()
In [4]:
m.show_summary()
TODO explain the different statistics
Morph.show_morph(view) supports plotting the morphology of the cell in three different view points:
- top view: xy
- front view: xz
- side view: yz
The cell body is depicted as a grey circle. Each branch point is marked with a circle. The color codes for branch order. The higher the branch order the brighter the color. Different neurite types are color-coded:
- axon: blue
- basal dendrites: red
- apical dendrites: purples
In [5]:
%matplotlib inline
m.show_morph(view='xy')
Out[5]:
Morph.show_treeviews() will plot all three views at the same time.
In [6]:
m.show_threeviews()
Out[6]:
Morph.show_animation() will generate a mp4 vedio of the cell morphology in 3D.
In [7]:
# m.show_animation()
(The example cell shown here is a pyramidal cell from enthorhinal cortex (Garden et al., 2008), taken from Neuromorpho.org http://neuromorpho.org/neuron_info.jsp?neuron_name=EC3-80604)
In [8]:
m.show_persistence_diagram()
Out[8]:
Summary result and processed swc can be saved by calling:
In [ ]: