allensdk.internal.morphology.validate_swc module

class allensdk.internal.morphology.validate_swc.TestNode(n, t, x, y, z, r, pn)[source]

Bases: object

allensdk.internal.morphology.validate_swc.resave_swc(orig_swc, new_file)[source]

Reads SWC file into AllenSDK Morphology object and resaves it. This can fix some problems in an SWC file that may disrupt other software tools reading the file (e.g., NEURON)

orig_swc: string

Name of SWC file to read

new_file: string Name of output SWC file


Tests SWC files for compatibility with AllenSDK

To be compatible with NEURON, SWC files must have the following properties:
  1. a single root node with parent ID ‘-1’
  2. sequentially increasing ID numbers
  3. immediate children of the soma cannot branch

To be compatible with feature analysis, SWC files can only have node types in the range 1-4:

1 = soma 2 = axon 3 = [basal] dendrite 4 = apical dendrite