Skip to content
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

Allow manual seeding of leaves #8

Closed
ChrisBeaumont opened this issue Oct 29, 2012 · 7 comments
Closed

Allow manual seeding of leaves #8

ChrisBeaumont opened this issue Oct 29, 2012 · 7 comments

Comments

@ChrisBeaumont
Copy link
Contributor

A feature I would find useful is the ability to pass a list of seed pixels to compute. The dendrogram would then be constructed in such a way that each leaf contains exactly one seed pixel. This would be helpful for, e.g., resolution studies.

@astrofrog
Copy link
Contributor

Actually, this could be done e.g. by a custom function as suggested in #7

@ChrisBeaumont
Copy link
Contributor Author

Reading #7 reminded me of this. Perhaps both can be addressed using callback functions

@astrofrog
Copy link
Contributor

@ChrisBeaumont - yes, in fact what I was suggesting is that all one needs to do in the scenario of #7 and the implementation of #10 is pass a function that will only accept a leaf as independent if it contains one of a list of seed pixels. However, I do agree that it would be nice to make this a little easier to use that requiring the user to have to write a custom function. We could either:

  • add a hard-coded initialization option when creating the dendrograms for the list of seed pixels

  • add a method that will prune a tree after the fact based on 'seed' pixels

  • add a helper function that could be passed to Example custom merge test function #10 and which just takes the list of seed pixels, e.g.:

    from astrodendro.helpers import seed_leaves
    d = Dendrogram.compute(image, merge_test_function=seed_leaves(x, y, v))

@ChrisBeaumont
Copy link
Contributor Author

I think #7 and #8 both have their uses, and they don't really interfere with each other. Your second suggestion seems like the best way to achieve what I was talking about, without complicating the __init__ or __compute__ signatures further.

@astrofrog
Copy link
Contributor

Do we still want to go with the second option now we've said (in other issues) that re-computing is preferable for now to pruning?

@ChrisBeaumont
Copy link
Contributor Author

Maybe not. Option 3 would be the simplest interface, since we want to use custom merger functions anyways. I think we should merge that code, and then make sure it's easy to use a custom merge test function to build a dendrogram with manually-specified seeds

@ChrisBeaumont
Copy link
Contributor Author

Closed via #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants