New Test


In [ ]:
import os
import sys
sys.path.append("/Users/RoozbehFarhoudi/Documents/Repos/Generative-Models-of-Neuron-Morphology/")
import numpy as np
import McNeuron
import matplotlib.pyplot as plt
from copy import deepcopy
%matplotlib inline

loc2 = "/Users/RoozbehFarhoudi/Documents/Repos/Generative-Models-of-Neuron-Morphology/Data/Interneuron/allen cell types/CNG version/Pvalb-IRES-Cre-Ai14-475124495.CNG.swc"
inter = McNeuron.Neuron(file_format = 'swc', input_file=loc2)
inter = inter.subsample(10.)
per = McNeuron.Perturbation(iterations = 1000,verbose=0)

In [ ]:
n = deepcopy(inter)
d = per.do_sliding(n)
n.set_nodes_values()

In [ ]:
d

In [ ]:
dn = McNeuron.Neuron(file_format = 'only list of nodes', input_file = deepcopy(n.nodes_list))

In [ ]:
new = n
gen = dn

In [ ]:
gen.distance_from_root[6]

In [ ]:
n.nodes_list[6].xyz

In [ ]:
np.array_equal(new.child_index, gen.child_index)

In [ ]:
print('parent index')
print new.parent_index - gen.parent_index
print('child_index')
print new.child_index - gen.child_index
print('branch_order')
print new.branch_order - gen.branch_order
print('angle_branch')
print new.branch_angle - gen.branch_angle
print('distance_from_root')
print new.distance_from_root - gen.distance_from_root
print('length_to_parent')
print new.distance_from_parent - gen.distance_from_parent
print('local_angle')
print new.local_angle - gen.local_angle
print('angle_global')
print new.global_angle - gen.global_angle
print new.location - gen.location