Hi @ailich,
see https://github.com/Nowosad/supercells/tree/estimate_compactness.
I took your code, cleaned it a bit, decided to return all the values (and not just summaries), and added an R function run_ce() -- try its examples.
It seems to work fine.
That being said, I started thinking about the whole process, and have an idea:
- Instead of creating new C++ and R functions, we could just add some if/else statements and arguments to existing functions.
- For example, there could be a new argument in R's
supercells() called meta_dists (better name needed!), and if this argument is TRUE, then three new columns are added to the final supercells: value_distance, spatial_distance, total_distance.
- These values would be calculated here (
|
double d = compute_dist(l, n, m, colour, dist_name, dist_fun); |
), but only when meta_dists = TRUE and only for the last iteration.
- For example, if you just want to get the gist of the distances distributions, you can do
meta_dists = TRUE and iter = 1; however, if you keep the default iter = 10 and set meta_dists = TRUE then your resulting supercells will have three new columns
- We could even think of calculating one or a few more columns, for example, an average distance for each supercell (which could be thought of as a quality measure)
@ailich, what do you think about this idea?
Hi @ailich,
see https://github.com/Nowosad/supercells/tree/estimate_compactness.
I took your code, cleaned it a bit, decided to return all the values (and not just summaries), and added an R function
run_ce()-- try its examples.It seems to work fine.
That being said, I started thinking about the whole process, and have an idea:
supercells()calledmeta_dists(better name needed!), and if this argument is TRUE, then three new columns are added to the final supercells:value_distance,spatial_distance,total_distance.supercells/src/generate_superpixels.cpp
Line 51 in 0e32e34
meta_dists = TRUEand only for the last iteration.meta_dists = TRUEanditer = 1; however, if you keep the defaultiter = 10and setmeta_dists = TRUEthen your resulting supercells will have three new columns@ailich, what do you think about this idea?