diff --git a/examples/synthesize_neuron.py b/examples/synthesize_neuron.py new file mode 100644 index 00000000..0636ce03 --- /dev/null +++ b/examples/synthesize_neuron.py @@ -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) diff --git a/test_data/bio/Fluo55_left.h5 b/test_data/bio/Fluo55_left.h5 new file mode 100644 index 00000000..1759ceeb Binary files /dev/null and b/test_data/bio/Fluo55_left.h5 differ diff --git a/test_data/bio/C220197A-P2.h5 b/test_data/valid/C220197A-P2.h5 similarity index 100% rename from test_data/bio/C220197A-P2.h5 rename to test_data/valid/C220197A-P2.h5