Skip to content

Commit

Permalink
Add valid bio example
Browse files Browse the repository at this point in the history
  • Loading branch information
lidakanari committed Mar 14, 2018
1 parent a312ad0 commit 566a3e3
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions examples/synthesize_neuron.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import tns
import tmd
import view

# Select output_path to save results
output_path = './Results/'
# Select a name for the synthesized neuron
output_name = 'TestNeuron'

# Extract distributions from cells in input directory
filename = './test_data/bio/'
distr = tns.extract_input.distributions(filename, diameter_model=True)

# Generate default parameters dictionary
params = tns.extract_input.parameters(neurite_types=['basal', 'apical'])

# Initialize a neuron
N = tns.Grower(input_distributions=distr, input_parameters=params, name=output_name)

# Grow your neuron
N.grow()

# Correct the diameters of your neuron
N.diametrize()

# Save your neuron to the selected output path
N.save(output_path=output_path)

# Load the generated neuron
n = tmd.io.load_neuron(output_path + output_name + '.h5'

# View your generated neuron
view.view.neuron(n)
Binary file added test_data/bio/Fluo55_left.h5
Binary file not shown.
File renamed without changes.

0 comments on commit 566a3e3

Please sign in to comment.