seung-lab / RealNeuralNetworks.jl

A unified framework for skeletonization, morphological analysis, and connectivity analysis.
Apache License 2.0
39 stars 2 forks source link

skeletonization is broken #50

Closed xiuliren closed 5 years ago

xiuliren commented 5 years ago

although the program runs, the output swc is not correct. It is not the same with previous version and there is an error while transforming to Neuron type:

connecting to a segment end...                                                                       
the closest segment is a terminal segment, merge the root segment of the other net                   
need to break the closest segment and rebuild connectivity matrix                                    
parentSegmentIdList = [6, 10]                                                                        
ERROR: LoadError: AssertionError: length(parentSegmentIdList) <= 1                                   
Stacktrace:                                                                                          
 [1] macro expansion at ./show.jl:556 [inlined]                                                      
 [2] merge(::Neuron, ::Neuron, ::Int64, ::Int64) at /usr/people/jingpeng/.julia/dev/RealNeuralNetwork
s/src/Neurons.jl:1121                                                                                
 [3] Neuron(::NodeNet) at /usr/people/jingpeng/.julia/dev/RealNeuralNetworks/src/Neurons.jl:75       
 [4] #trace#3(::String, ::UInt32, ::String, ::Tuple{Int64,Int64,Int64}, ::String, ::Function, ::Int64
) at /usr/people/jingpeng/.julia/dev/RealNeuralNetworks/scripts/skeletonize.jl:42                    
 [5] (::getfield(Main, Symbol("#kw##trace")))(::NamedTuple{(:swcDir, :mip, :voxelSize, :meshName, :se
gmentationLayer),Tuple{String,UInt32,Tuple{Int64,Int64,Int64},String,String}}, ::typeof(trace), ::Int
64) at ./none:0                                                                                      
 [6] macro expansion at ./logging.jl:322 [inlined]                                                   
 [7] main() at /usr/people/jingpeng/.julia/dev/RealNeuralNetworks/scripts/skeletonize.jl:103         
 [8] top-level scope at none:0                                                                       
 [9] include at ./boot.jl:317 [inlined]                                                              
 [10] include_relative(::Module, ::String) at ./loading.jl:1038                                      
 [11] include(::Module, ::String) at ./sysimg.jl:29                                                  
 [12] exec_options(::Base.JLOptions) at ./client.jl:239                                              
 [13] _start() at ./client.jl:432                                                                    
in expression starting at /usr/people/jingpeng/.julia/dev/RealNeuralNetworks/scripts/skeletonize.jl:1
37                                                                                                   
xiuliren commented 5 years ago

https://github.com/seung-lab/RealNeuralNetworks.jl/commit/37fd12339c461c5b3fb09b1625d281123f4e6bc7

fixed the running. the bug is from setting false connection in the connectivity matrix. so there are false values in the connectivity matrix. dropzeros! function fixed this bug.