Skip to content

Commit

Permalink
Update hemibrain_reroot.R
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbates committed Aug 25, 2023
1 parent bdd446e commit aae8d4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/hemibrain_reroot.R
Original file line number Diff line number Diff line change
Expand Up @@ -434,14 +434,14 @@ remove_bad_synapses.neuron <- function(x,
from = nat::rootpoints(x),
to = primary.branch.point,
mode = "all")$vpath)))
x$connectors[x$connectors$treenode_id%in%pnt,"status"]="near_pnt"
x$connectors[x$connectors$treenode_id%in%pnt,"status"]="on_pnt"
syns = unique(x$connectors$treenode_id)
syns = (1:nrow(x$d))[match(syns,x$d$PointNo)]
# not within radius of pnt
dists = igraph::distances(nat::as.ngraph(x), v = pnt, to = syns, mode = "all")
dists = apply(dists, 2, function(x) sum(x<min.nodes.from.pnt))
names(dists) = syns
x$connectors[x$connectors$treenode_id %in% names(dists)[as.numeric(dists)==0],"status"]="on_pnt"
x$connectors[x$connectors$treenode_id %in% names(dists)[as.numeric(dists)==0],"status"]="near_pnt"
}
if(soma){
# not within radius of soma
Expand Down

0 comments on commit aae8d4a

Please sign in to comment.