-
Notifications
You must be signed in to change notification settings - Fork 5
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
Unify utility classes for operation on graphs #13
Comments
there's also https://github.com/mastodon-sc/mastodon-tomancak/blob/master/src/main/java/org/mastodon/mamut/tomancak/util/SpotsIterator.java that allows to apply operations on visited spots (usage example here or here) |
Just as a reminder: (mastodon-sc/mastodon#229) |
Hello all, I am working on this currently and need your input: LineageTreeUtils.javaThe The BranchGraphUtils.javaI think we could make it generic, i.e., working for SpotsIterator.javaI would wait to move this class. I feel that it could simplified, or even rewritten with calls to more generic methods. |
Hi @tinevez
There is also this method, which could be added there (generic already): https://github.com/mastodon-sc/mastodon-deep-lineage/blob/master/src/main/java/org/mastodon/mamut/util/LineageTreeUtils.java |
I don't know... I just didn't know that I don't mind which class is used for the traversing... happy to convert to the one thing, however, I would love to keep having around... the SpotsIterator was designed with the contract that, yes, it's traversing the graph but either the full graph (when no spots are selected in the Mastodon) or sub-graph (defined by the selected spots in the Mastodon)... so client code's consumer of spots can work either on full graph or just on a arbitrary run-time defined user selection/part of the graph --> super convenient for users if they want to limit the scope of a plugin's operation |
Hello @tinevez,
I see your point. The public static < V extends Vertex< ? > > RefSet< V > getRoots( final ReadOnlyGraph< V, ? > graph )
{
RefSet< V > roots = RefCollections.createRefSet( graph.vertices() );
for ( final V v : graph.vertices() )
if ( v.incomingEdges().isEmpty() )
roots.add( v );
return roots;
} I would suggest to have a
Yes. Here is a generic version of the
I agree. I would keep the class in mastodon-tomancak. It would be misplaced in |
Oki! I see that you prepared everything already, for the move to mastodon-graph. |
This repository has classes LineageTreeUtils and BranchGraphUtils. These classes should become part of mastodon-collection.
There is also https://github.com/maarzt/mastodon-blender-view/blob/master/mastodon-plugin/src/main/java/org/mastodon/blender/BranchGraphUtils.java
The text was updated successfully, but these errors were encountered: