How to use z-stacking software for microscopes

When peering through a microscope lens, it can be difficult (if not impossible) to bring your entire specimen into focus all at once.  

In most cases, this isn’t a major issue.

The real problem arises when taking photos, as blurry edges can ruin an otherwise perfect shot.

But don't worry, there's a straightforward solution to this problem – focus stacking, also known as z-stacking.

What is z-stacking?

Z-stacking is a wonderful way to overcome the technical limits of your microscope – specifically its depth of field.

Typically, you can only keep a certain depth of the image in focus at any given moment.

But how can you capture a complete and focused photo if only a portion of the specimen is in focus, let’s say one-third?

The solution is straightforward: capture an image of each third and then merge them into a single image.

By taking multiple images of the specimen, each with a slightly different focal point, and using specialised software to combine them, you can produce a final image that is entirely in focus.

This technique is particularly useful for capturing highly detailed specimens, such as those used in scientific research or artistic photography.

By Muhammad Mahdi Karim - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=11023060 

What do you need?

To begin, you’ll need a microscope with a camera and z-stacking software at your disposal.

Fortunately, many microscope cameras come pre-installed with their own z-stacking software, simplifying the process.

However, if your microscope doesn’t have this feature or if you prefer to use different software, there are several free options available online that you can use.

Just be sure to select software that is compatible with your microscope and camera to ensure optimal results.

With these essential tools in hand, you’ll be well-equipped to take highly detailed and focused images of your specimens.

How does it work?

There are two steps involved in z-stacking – taking your photos and running the software.

Taking your photos

Taking photos for z-stacking is like piecing together a jigsaw puzzle, where each photo is a piece that contributes to the complete image.

To ensure that every part of your specimen is in focus, you need to take a series of photos, starting from the upper layer of the specimen and gradually adjusting the focus deeper until you reach the bottom.

You can do this process by hand, adjusting the focus yourself, or you can use camera software that automatically takes photos at set time intervals while you adjust the focus.

You can take as many photos as you need to make sure that the whole specimen is in focus. It doesn't matter how many you take, as long as you end up with a complete picture of the specimen.

Here are some additional tips:

  • When using a stereo microscope with an eyepiece camera, adjusting the focus may cause the image to drift to the side.
  • Use the various exposure and lighting options available in most microscope camera software to find the best settings for your particular specimen.
  • Be careful not to adjust the focus too quickly when using automated imaging software, as this may cause blurring. 

Running the software

Once you have your photos, the next step is to ‘stack’ them using your software.

While the exact procedure will vary depending on the program you use, it’s usually just a matter of selecting the particular photos you wish to blend and running the software.

The software will collate all the individual photos to produce a beautiful, wholly in-focus image of your specimen.

Depending on your program, it may even give you several slightly different versions of the final image to choose from, based on different stacking algorithms.

So, if you’re ready to take your microscope photography game to the next level – get stacking!

Next article Phase contrast microscopy explained