NodeNets

RealNeuralNetworks.NodeNets.alexs_penaltyFunction
alexs_penalty( weights, dbf )

Returns a version of the edge weights, modified by the DBF-based teasar penalty:

w = w * 5000 .* (1 - dbf/maxDBF).^(16)

The factor of 5000 shouldn't make a difference, but I've left it here

source
RealNeuralNetworks.NodeNets.distill!Method

Parameters:

point_array: a Nx3 array recording all the voxel coordinates inside the object.
path_nodes: the indexes of nodeNet voxels in the point_array 
path_edges: the index pairs of nodeNet in the point_array

In the pathnodes, the nodes were encoded as the index of the pointarray. Since we do not need pointarray anymore, which could be pretty big, we'll only reserve the nodeNet coordinates and let the gc release the pointarray. the same applys to path_edges

source
RealNeuralNetworks.NodeNets.get_neuroglancer_precomputedMethod

get binary buffer formatted as neuroglancer nodeNet.

Binary format

UInt32: number of vertex
UInt32: number of edges
Array{Float32,2}: Nx3 array, xyz coordinates of vertex
Array{UInt32,2}: Mx2 arrray, node index pair of edges

reference: https://github.com/seung-lab/neuroglancer/wiki/Skeletons

source
RealNeuralNetworks.NodeNets.make_neighbor_graphMethod
make_neighbor_graph( points )

Creates a LightGraphs graph from a point cloud, such that each point has a node (indexed in the same order as the rows), and each node is connected to its neighbors (by 26-connectivity).

Also returns a sparse matrix of weights for these edges equal to the euclidean distance between the indices of each point. These can be weighted or modified easily upon return.

source
RealNeuralNetworks.NodeNets.remove_path_from_rns!Function
remove_path_from_rns!( reachableNodeList, path, points, sub2node, dbf, max_dims, scale_param, const_param)

Identifies the nodes to remove from the reachable nodes within the graph. Probably the ugliest function here, and should be optimized later

TO OPTIMIZE

source
RealNeuralNetworks.NodeNets.saveMethod
save(self::NodeNet, cellId::UInt32, d_json::Associative, d_bin::Associative)

save nodeNet in google cloud storage for neuroglancer visualization the format is the same with meshes

source
RealNeuralNetworks.NodeNets.translate_to_origin!Method
translate_to_origin!( points::Matrix{T} )

Normalize the point dimensions by subtracting the min across each dimension. This step isn't extremely necessary, but might be useful for compatibility with the MATLAB code. record the offset and add it back after building the nodeNet

source
RealNeuralNetworks.NodeNets.DBFs.compute_DBFMethod
compute_DBF( pointCloud )

Returns an array of DBF values for the point cloud. Currently creates a binary image, and runs bwd2 on it, though ideally we'd get rid of the need for an explicit bin_im

source
RealNeuralNetworks.NodeNets.DBFs.distance_transformMethod
distance_transform( d::AbstractArray{T,N}, voxelSize::Vector{Float32}=ones(Float32, N) )

Returns a euclidean distance transformation of the mask provided by d. The return value will be a volume of the same size as d where the value at each index corresponds to the distance between that location and the nearest location for which d > 0.

source