Online tools of questionable usefulness
While on the Gnotero page (a Python app for accessing refs from Zotero, a Firefox plugin-based citation manager, in case you’re wondering), I noticed that the same group has an Online Gabor Patch Generator. Cool. Thanks, guys. But who uses this? Are there researchers who are savvy enough to put Gabor patches to use, but not savvy enough to bang out the 2-line MATLAB code for generating one*? Anyways, it also reminded me of some online calculators I came across a while ago.
Diffraction order angles calculator
Focused spot size calculator
There’s more at the same site. I appreciate these tools being around, but when do they get used? When I’m designing an optical system, I’m plotting a family of curves, modeling, and things like that. Not just plugging-and-chugging through one equation. By contrast, I thought this one was kind of fun: Excitations per molecule for 2p calculator
And on the topic of calculators, converting between light units can be annoying because light is measured in different ways. Some papers report total flux, others make point measurements… some normalize to the sensitivity of the eye (e.g., lux, lumen)… some calculate in terms of solid angle (radiant intensity)… etc. Here is a collection of calculators that is not comprehensive, but certainly helpful for converting.
*In case you’re curious, this is the two-line MATLAB code that generates a Gabor patch.
[xx,yy] = meshgrid(-halfSize:halfSize, -halfSize:halfSize); patch = imrotate(exp(-((xx/gaussEnv).^2)-((yy/gaussEnv).^2)) .* sin((2*pi*spatialFreq).*xx),angle,'crop');
Guess it could be useful if you’re in the process of making a Powerpoint and don’t have Matlab handy at that point in time. Actually, what /would/ be great is a moving plaid/Gabor movie generator (I know, you can do it Matlab, but I always get codec issues).
[…] a previous post, I gave the two line MATLAB code to generate a Gabor patch. At the other end of the spectrum, this web page spends an entire MATLAB tutorial on making a Gabor […]
If MATLAB’s imrotate function is used to rotate the Gabor patch, using bicubic scaling (rather than nearest-neighbor, which is the default) produces a better result.
However, in my opinion, it’s preferable to simply apply a rotation to the raw data themselves rather than relying on a toolbox function. For example:
halfSize = 256;
gaussEnv = 32;
spatialFreq = 0.1;
angle = 32;
[xx,yy] = meshgrid(-halfSize:halfSize, -halfSize:halfSize);
sinePart = sin(2*pi*spatialFreq * (xx*cosd(angle) + yy*sind(angle)));
gaussianPart = exp(-((xx/gaussEnv).^2 + (yy/gaussEnv).^2));
imshow(gaussianPart.*sinePart, []);
(I realize this post is a few years old, but it’s near the top of google’s results for the query “gabor patch”.)
Thanks!
A lot of old posts, including this one, still see decent amounts of traffic. Your input is very much appreciated.