Closed ChrisBeaumont closed 11 years ago
Actually, this could be done e.g. by a custom function as suggested in #7
Reading #7 reminded me of this. Perhaps both can be addressed using callback functions
@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 helper function that could be passed to #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))
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.
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?
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
Closed via #10
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.