schuetzgroup / sdt-python

Python library for fluorescence microscopy data anlysis
48 stars 8 forks source link

Use some kind of cluster analysis to assign components in motion.MsdDist #1

Closed lschr closed 4 years ago

lschr commented 4 years ago

Currently, the assignment of MSD and weight to a component is based on the order the parameters are returned by the fit. This can lead to wrong assignment.

K-Means may be a good tool for this as the number of clusters is known (n_components).

lschr commented 4 years ago

K-means (and probably any clustering algorithm) has to be run for each lag time separately and thus components could be assigned inconsistently across lag times. Therefore assign components either according to ascending MSDs or weights.

This was implemented in fc5b60d44c51599490484b3c9389771b10d8351c and 4b7767cff8bfd18164d83d7a428551a2b2c38a53.