Split a neuron using a data.frame
of stored split points.
hemibrain_use_splitpoints(x, df, knn = FALSE, ...)
x | a |
---|---|
df | a |
knn | logical, whether or not to find corresponding points
between |
... | Additional arguments passed to methods or eventually to
|
a neuronlist
# \donttest{ # Choose neurons ## These neurons are some 'tough' examples from the hemibrain:v1.0.1 ### They will split differently depending on the parameters you use. tough = c("5813056323", "579912201", "5813015982", "973765182", "885788485", "915451074", "5813032740", "1006854683", "5813013913", "5813020138", "853726809", "916828438", "5813078494", "420956527", "486116439", "573329873", "5813010494", "5813040095", "514396940", "665747387", "793702856", "451644891", "482002701", "391631218", "390948259", "390948580", "452677169", "511262901", "422311625", "451987038" ) # for documentation purposes only run first 5 examples tough=tough[1:5] # Get neurons neurons = neuprintr::neuprint_read_neurons(tough) # Now make sure the neurons have a soma marked ## Some hemibrain neurons do not, as the soma was chopped off neurons.checked = hemibrain_skeleton_check(neurons, meshes = hemibrain.surf)#>#>#> Warning: invalid factor level, NA generated#> Warning: invalid factor level, NA generated#> Warning: invalid factor level, NA generated#> Warning: invalid factor level, NA generated#> Warning: invalid factor level, NA generated#> Warning: invalid factor level, NA generated# Split neuron ## These are the recommended parameters for hemibrain neurons neurons.flow = flow_centrality(neurons.checked, polypre = TRUE, mode = "centrifugal", split = "distance") # Save the results splitpoints = hemibrain_splitpoints(neurons.flow) # Re-use the results neurons.flow.2 = hemibrain_use_splitpoints(neurons, splitpoints, knn = FALSE)#> Error in if (is.na(dendrite.primary)) { dendrite.primary = dendrite.start[1]}: argument is of length zeroif (FALSE) { # Plot the split to check it nat::nopen3d() nlscan_split(neurons.flow2, WithConnectors = TRUE) }# }