Posts tagged with optics

Next time you’re explaining TIRF to someone, start off by showing them this piece of artwork. (Arndt von Scheidt, source)

Fun fact for the day: ThorLabs’ SM2 lens tube standard screws right onto the front end of Nikon’s SLR lenses. Other manufacturers probably use the same threading, I just haven’t tried them.

I don’t know if this is by design or not, but it makes coupling 35mm SLR lenses into optical setups fairly straightforward. I’m using it for a tandem lens macroscope. In the picture above I used ThorLabs part SM3A2. BTW, they also sell some F-mount adapters for connecting to the other side of the lens.

This is a long post. If you’re in a rush, then just read these first two paragraphs.

One of the early posts on this blog was about structured illumination. Specifically, I spoke about Mats Gustafsson’s version, which yields superresolution imaging, in the wide-field mode. Just recently, JM commented on that post and asked if there was any kind of guide on how to get this set up and running. Besides the usual sources (methods sections, co-authors, etc.), I’m not aware of any such guide. However, I have corresponded a few times with Mats over the years and he was always overwhelmingly helpful.

He passed away earlier this year and there have been a few articles written about his landmark work, his thoroughness, and his kindness (Nature Methods, HHMI). In this post, I want to share some excerpts from his emails to me. They’re not personal (we were just acquaintances), they’re technical. In addition to them being useful to people who may be putting together their own patterned illumination rig, I think they also give a small insight into how kind of a person Mats was. He took the time to write these detailed responses to just some postdoc that he met at a small conference.

Read the rest of this entry »

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');

In the last post, I mentioned how the “minification” factor (the diameter of the PMT detector divided by the diameter or the back plane of the objective), greatly affects the layout of the collection optics. Here’s a graph and the associated MATLAB code for looking at this relationship. If you need to fit two dichroics in the collection pathway (IR/vis and red/green, for example) then you’ll need a larger distance between the objective and the collection lens.

Also consider the diameter of the objective’s back plane. If it is one of the large NA, low mag objectives, it will be quite large and you’ll want to use at least a 25mm collection lens, if not larger. By contrast, if you’re using a 40x/0.8 objective, you can probably get away with smaller lenses and closer positioning.

%% Magnification, dist_obj_cl, f_cl
% Eqn. 3.21 from Tsai et al. 2009 (CRC); abs(mag)=f_cl/(dist_obj_cl-f_cl)
% Can be rewritten dist_obj_cl = (f_cl/mag) + f_cl
% Below, for brevity, we use L1 = dist_obj_cl

clear f_cl L1
% Make a family of curves relating these quantities.
f_cl = 5:5:50; % Collection lens focal lengths, in mm.
mag = 0.2:0.05:0.5; % Magnification factors.

for m=1:numel(mag)
    for f=1:numel(f_cl)
        L1(f,m) = (f_cl(f)/mag(m)) + f_cl(f);
    end
end

for m=1:numel(mag)
    M{m}=num2str(mag(m)); % Labels for the different mag lines
end
figure
plot(f_cl,L1);
xlabel('f_C_L: Focal length of collection lens (mm)')
ylabel('L_1: Distance from objective back plane to collection lens (mm)')
legend(M,'Location','NorthWest')
legend('boxoff')
title('Relation between f_C_L and L_1 for different magnifications')

The Tsai book chapter from Ron Frostig’s CRC book is a great resource for building your own 2p microscope. In section 3.3.7.2, they describe how to design the collection optics. They use a straightforward single lens design, lay out the optics equations, and show a family of curves for several variables (Fig. 3.14). They do an excellent job of giving the reader an intuitive feel for the engineering compromises inherent in these systems.

I’ve found myself repeatedly going through these calculations for different magnification factors. Or “minification” factors, as is typically the case, since the back aperture of the objective is imaged onto the PMT, which is typically about a third to a quarter of the size.

In order to save time, I wrote a tiny MATLAB program to reproduce Fig 3.14 and overlay points indicating where to place the optics in order to have a particular magnification factor. I used it to generate the figure above.


%% Dist_cl_pmt, dist_obj_cl, f_cl
% Eqn. 3.18 from Tsai et al. 2009 (CRC);
% dist_cl_pmt = (dist_obj_cl * f_cl) / (dist_obj_cl - f_cl)
% Below, for brevity, we use L1 = dist_obj_cl
% Below, for brevity, we use L2 = dist_cl_pmt

% Make a family of curves relating these quantities.
f_cl = 5:5:50; % Collection lens focal lengths, in mm.
L1 = 50:1:250; % dist_obj_cl
mag = 0.24; % Magnification factor.

for f=1:numel(f_cl)
    for L=1:numel(L1)
        L2(f,L) = (L1(L)*f_cl(f))/(L1(L) - f_cl(f));
    end
    L1m(f) = (f_cl(f)/mag) + f_cl(f);
    magloc(f)=locateVal(L1m(f),L1);
    L2m(f) = L2(f,magloc(f));
end

for f=1:numel(f_cl)
    M{f}=num2str(f_cl(f)); % Labels for the different mag lines
end
figure
plot(L1,L2);
xlabel('L_1: Distance from objective back plane to collection lens (mm)')
ylabel('L_2: Distance from collection lens to PMT (mm)')
axis([50 250 0 200])
legend(M,'Location','NorthEast')
legend('boxoff')
title(sprintf('Relation between L_1 and L_2 for different f_C_L, indicating positions for mag=%g',mag))
hold on
plot(L1m,L2m,'o')
hold off

Fiber optics must be terminated properly in order to permit high transmission. If you’re making your own, get a proper fiber cleaver and a set of polishing sheets. Here are a few good references: ThorLabs, LANshack, Datacottage

On the subject of fiber optics, I had a conversation with someone at our recent single cell electroporation workshop about running pulses from a Ti:Sapph laser through a fiber. It is possible to do so, without massive pulse dispersion, using a hollow core photonic band-gap fiber (ref, ref). It can also be done with a single mode fiber, but requires more kit (ref).

I recently had the pleasure of visiting Garret Stuber’s new lab at UNC-Chapel Hill. He has an exciting program going with optogenetics and I was impressed with the high quality fiber optic work in his lab. They’re really doing everything right.


I use SolidWorks to design custom parts for my rigs. Many times, these parts mate with existing Thorlabs parts. Fortunately, Thorlabs offers SolidWorks files that can be directly added to an assembly to ensure everything fits. It’s easy to fix relationships between parts (e.g., force a part to slide along posts in the cage system), and determine how everything fits together.

In the screenshot above, some of you probably recognize the Thorlabs cubes, like Darcy was talking about recently, which are so handy. Here, I use one as a enclosure for a dichroic flipper (custom designed in SolidWorks, then 3D printed), and another in the collection pathway.

Thorlabs recently broke ground on a new corporate headquarters in New Jersey. They’re clearly doing a lot of things right. I like their easy-to-navigate website, fast shipping, and how they share a lot of technical information on their parts (including the SolidWorks files of the parts as mentioned in this post).

Post by Darcy Peterka (Columbia University/Yuste lab):

We do a bunch of multiple imaging/uncaging experiments with 2+ lasers, and got tired of constantly taking apart the camera/laser ports to switch lenses and dichroics. This setup allows easy inspection of the conjugate planes to the sample and back aperture. These are just Thorlabs cubes (C4W) with the kinematic cage platforms (B4C) and dichroics holders (FFM1). They aren’t the most precise pieces, but they are easy to use and align, and are quite flexible. The upper lens off to the left is on a translator to allow easy compensation of the longitudinal chromatic aberration of the microscope for the different colors on the beam paths (~800nm and 1064nm), which would otherwise kill us during our experiments.

Depending on the objective, laser combo, we may have to move up to a centimeter. Part of the long travel required is because the divergence properties of our 1064nm fiber lasers seem to change more often than we’d like, so we end up doing compensation. I could off-load that task to another telescope, but it is easy enough to change here. Assuming everything is perfectly collimated beams, the difference in axial focus of the 60x 1.1 NA objective is two microns with 800nm and 1064nm light – large enough to screw up experiments with neuronal spines and dendrites.

Structured illumination can be used to increase the resolution of wide field fluorescence imaging. The idea is best motivated by thinking about Moire fringes. In panel (a) below, if you stand away from the screen at some point the two gratings will appear each as gray panels rather than gratings. Thus, this low spatial frequency pattern is revealing information that exists beyond the resolving power. This technique can offer at least a doubling of spatial resolution, and in the presence of nonlinear saturation effects, can theoretically offer unlimited resolution.

Read the rest of this entry »