Re: future.graph.merge_hierarchical
Hi Juan, Because Vighnesh is smarter than me :) I can't see how to obtain the intermediate merger other than to create a complete label_map at each step, which requires me to iterate over all the nodes in the graph. I sure there is enough information at node to reconstruct just local map/mask but I don't know how. Hope that clarifies. Regards, Michael. -- On 21/09/2015 8:50 am, Juan Nunez-Iglesias wrote:
Hey Michael,
I don't understand your question. Why are you traversing the graph "each time"? Vighnesh only traverses it once?
Juan.
On Sun, Sep 20, 2015 at 6:55 AM bricklemacho@gmail.com mailto:bricklemacho@gmail.com
mailto:bricklemacho@gmail.com> wrote: Hi Vighnesh,
I am struggling with both Python and the graph stuff, hope you can help me. I have taken discussion off list.
I am using your idea in your blog: Hierarchical Merging In Action. Similar to your seg_list[] concept, I plan to store a copy of the merged regions in a list. The best place appears to be at bottom of the while loop in merge_hierarchical (about line 130 in graph_merge.py). Default plan is to duplicate Lines 132-136 of graph_merge.py to create a label map:
label_map = np.arange(labels.max() + 1) for ix, (n, d) in enumerate(rag.nodes_iter(data=True)): for label in d['labels']: label_map[label] = ix
Seems bit of an overkill to traverse the entire graph each time. Is there any other way you can suggest? All I need is a label map that consists of two labels, one being the merged region and everything else grouped/labeled as another region.
Any help appreciated.
Regards,
Michael. --
On 19/09/2015 11:51 am, Vighnesh Birodkar wrote:
Hello
I am sorry, I was mistaken, there is no way of getting the merge sequence right now without changing the source.
Thanks
On Fri, Sep 18, 2015 at 9:46 PM, bricklemacho@gmail.com mailto:bricklemacho@gmail.com
mailto:bricklemacho@gmail.com> wrote: Hi,
My graph theory is pretty weak so I may be missing something obvious. Can you elaborate a little more on your suggestion below.
Are you saying the setting in_place=False, will the graph then retain a copy of the intermediate steps? If so how do I access these intermediate steps?
Playing around with RAG Merging example (from the skimage gallery). If set rag_copy=True, I will have the starting graph, and can use the labels returned from merge_hierarchical to see the result of final merge, but I can't see way to review the intermediate steps.
Any help appreciated,
Michael. --
On 18/09/2015 10:30 pm, Vighnesh Birodkar wrote:
Hi
Using in _ place = False, couldn't you get the entire sequence of merging from the root node ?
On 17 Sep 2015 12:59, "bricklemacho@gmail.com mailto:bricklemacho@gmail.com"
mailto:bricklemacho@gmail.com> wrote: Setting the threshold to infinity will merge everything, but in what order are the nodes merged?
Assuming setting threshold to infinity works, I still need to save a copy of each merge. Any suggestions?
Regards,
Michael. --
On 17/09/2015 11:23 pm, Vighnesh Birodkar wrote:
Hello
Rather than creating an alternative method, you could always set the threshold to infinity. Won't that work in your case ?
Thanks Vighnesh
-- You received this message because you are subscribed to a topic in the Google Groups "scikit-image" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/scikit-image/rnsVLQ-tFJM/unsubscribe. To unsubscribe from this group and all its topics, send an email to scikit-image+unsubscribe@googlegroups.com mailto:scikit-image+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
-- You received this message because you are subscribed to the Google Groups "scikit-image" group. To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe@googlegroups.com mailto:scikit-image+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
-- You received this message because you are subscribed to a topic in the Google Groups "scikit-image" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/scikit-image/rnsVLQ-tFJM/unsubscribe. To unsubscribe from this group and all its topics, send an email to scikit-image+unsubscribe@googlegroups.com mailto:scikit-image+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
-- You received this message because you are subscribed to the Google Groups "scikit-image" group. To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe@googlegroups.com mailto:scikit-image+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
-- You received this message because you are subscribed to the Google Groups "scikit-image" group. To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe@googlegroups.com mailto:scikit-image+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
-- You received this message because you are subscribed to the Google Groups "scikit-image" group. To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe@googlegroups.com mailto:scikit-image+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
participants (2)
-
bricklemacho@gmail.com
-
Vighnesh Birodkar