john-judge / TSM-to-ZDA

Data acquisition with TurboSM and data processing with PhotoZ
MIT License
0 stars 0 forks source link

ROI identification #4

Open john-judge opened 2 years ago

john-judge commented 2 years ago

ROI_identification.ipynb

image

john-judge commented 2 years ago

Wen-Chi's data (06_01_01.zda)

image

AIC/BIC in 0-50: image

AIC/BIC in 50-80: image

AIC in steps of 4: image

AIC in steps of 6: image

AIC in steps of 10: image

AIC in steps of 20: image Finally seems like an elbow exists around 190.

But plotting shows that something strange and likely invalid is happening at k=190: image

k=140 is possibly better. But then again it doesn't qualitatively look much more useful than k=90, for this particular dataset image

john-judge commented 2 years ago

7/12/22 Data, 01_01_09

image

[85, 95]

Here are the sampled points in the percentile range [85, 95]: image Resulting clusters (k=85): image Example traces for these clusters (now writing to region DATs for load into PhotoZ): image

[95, 100]

Here are the sampled points in the 95% percentile: image Resulting clusters (k=85): image Example traces for these clusters: image

[85, 100]

Finally, for comparison, clustering is performed on the lumping together of the previous two percentile ranges. image Resulting clusters (k=85): image

Method Development

It could possibly make a lot of sense to “stratify” the pixels by SNR ranges and then perform clustering on these SNR ranges separately.

Then the groups of clusters are recombined. If two clusters are touching, the one from the lower-SNR-percentile group is discarded (because the contiguous low-SNR ROIs are probably the “halo” around or between higher-SNR ROIs).

On Choice of Percentile Ranges Based on Dataset

This dataset just happened to behave nicely with filtering to 95th percentile, maybe because with the 40 uA stim, the stim site doesn’t dominate with holding all the high-SNR pixels, and the 95th percentile is more evenly distributed, both in intensity and space.

john-judge commented 2 years ago

Implemented "Strata" idea (mentioned in previous post) and other filters on clusters

image

john-judge commented 2 years ago

Comparison to Kate's K-means clustering (KKM)

image

Kate mentions that KKM is usually followed by manually selecting about half of the clusters shown above.

john-judge commented 2 years ago

Comparison after KKM manual filtering

image