Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve heal skeleton option #32

Closed
jefferis opened this issue Jan 26, 2020 · 7 comments
Closed

improve heal skeleton option #32

jefferis opened this issue Jan 26, 2020 · 7 comments

Comments

@jefferis
Copy link
Contributor

@alexanderbates although I haven't checked in detail, the heal skeleton option looks a bit too simple to be doing the right thing. @SridharJagannathan has a new implementation that we should be able to use.

@jefferis
Copy link
Contributor Author

See

neuprintr/R/neurons.R

Lines 183 to 198 in bf67208

heal_skeleton <- function(x, ...){
n = nat::as.ngraph(x)
mstree = igraph::mst(graph = n, ...)
healed = nat::as.neuron(mstree)
if(healed$nTrees>1){
fragmented = break_into_subtress(healed)
healed = stitch_neurons(x=fragmented)
}
if(nat::is.neuron(x)){
healed$connectors = x$connectors
#healed$d = merge(healed$d, x$d)
healed
}else{
healed$d
}
}

@SridharJagannathan
Copy link
Collaborator

@alexanderbates It is available here: https://github.com/natverse/nat/blob/feature/elmr_features/R/neuron.R#L1107 and will be merged to master after review by @jefferis next week.

@jefferis
Copy link
Contributor Author

An example off a neuron that is split into 5 separate parts, 1 of which seems to be pathological. Would be good to think about giving stitch_neurons_mst an edge length threshold.

n5813054304=neuprint_read_neuron_simple(5813054304, heal = F)

@SridharJagannathan
Copy link
Collaborator

SridharJagannathan commented Jan 29, 2020

Hmm, just attaching the figure with the latest implementation of nat::stitch_neurons_mst where the pathological part is also connected (which needs to be fixed)
Screenshot 2020-01-29 at 12 08 39

@SridharJagannathan
Copy link
Collaborator

I have made a new implementation in nat::stitch_neurons_mst which has a parameter thresh_el that has the edge length threshold. Only edges below this threshold will be added (currently fixed at 1000 microns). See test below (the green is the current output, overlayed on top of blue previous ouput)
Screenshot 2020-01-29 at 14 48 17

@jefferis
Copy link
Contributor Author

Just a note that we are getting close to having a fast/robust implementation of the new healing code in natverse/nat#424. There was also a separate change in as.seglist.igraph that offers significant speed-ups.

@jefferis
Copy link
Contributor Author

jefferis commented Feb 7, 2020

Closed by #76

@jefferis jefferis closed this as completed Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants