BUNPC / psoct_vessel_graphing

Suite of tools for segmenting vessels from PS-OCT images and then converting the segments to a graph.
1 stars 6 forks source link

Regraph Connects Unconnected Edges #1

Closed mjhyman closed 12 months ago

mjhyman commented 1 year ago

downsample_nodes() down samples the nodes according to the input ds_rate. The variable hxy, hz are used to represent the down sample rate. The code will search within a cubical perimeter [ (X +/- hxy), (Y +/- hxy), (Z +/- hz) ] for each node. For example, consider the first node in the list to be Node1. If there is a second node (Node2) within the perimeter, then the code will remove Node2. Then, any edge that referenced Node2 will now reference Node1.

Temporary fix:

Rigorous fix:

The downsample_nodes function returns an array of nodes and edges. The edges array contains indices of the nodes. This function is returning more an array of nodes that exceeds the maximum index in the edges array.

gongdayang commented 1 year ago

Jus want to add my observation to this practice, "First run prune_loops to remove loops within each segment. This should be run BEFORE regraphing."

I ran a dataset with 103,146 as its endnodes length before regraphing (downsampling). After 4 days of running, the prune_loops.m only went through 15,021 in the for loop for uu = 1:length(endnodes). However, if I do regraphing first, the prune_loops script will finish in 1 hour.

Regraphing reduced the complexity of the graph so pruning become less computationally intensive, but current regraphing script could introduce error (connect the unconnected edges).

mjhyman commented 1 year ago

Thank you for the note. I just updated the ticket.

mjhyman commented 12 months ago

This issue was resolved, and the branch was merged into develop.