Last active
January 29, 2022 19:18
-
-
Save mutterer/3894e2441de94465e0dda89617f7bc00 to your computer and use it in GitHub Desktop.
compare center of mass and gaussian fit.ijm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// see https://twitter.com/Maurice_Y_Lee/status/1487093624982499330 | |
// show center of mass | |
makePoint(getValue('XM'),getValue('YM'),"medium green hybrid"); | |
Overlay.addSelection('green'); | |
// gaussian fit | |
makePoint(gaussianFit(true),gaussianFit(false),"medium red hybrid"); | |
Overlay.addSelection('red'); | |
run("Select None"); | |
function gaussianFit(horizontal) { | |
run("Select All"); | |
if (!horizontal) setKeyDown('alt'); | |
k=getProfile(); | |
Fit.doFit("Gaussian",Array.getSequence(k.length), k); | |
return Fit.p(2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment