Focus Stacking for Teaching and Publication in Plant Sciences

This project aims to design a teaching tool and curriculum to teach focus stacked photography to secondary school children and undergraduates. This project follows on from Biomaker Challenge project Macrophotography of fern gametophytes using a DIY focus stacking system


Part 1: Deegan, J. (2017). Photographing The Fern Gametophyte Developmental Series – The First Attempt. Pteridologist, 6 (4), 263-265.

Part 2: Deegan, J. I., & Deegan, T. (2018).  Macrophotography of Fern Gametophytes Using a Focus Stacking System. Pteridologist, 6 (5), 357-360.

The Idea

It has only recently become possible to take photographs of tiny plant specimens and have the full subject in focus. The technology is called focus stacking or deep focus photography. In this technique a large number of photographs are taken, while gradually moving the camera towards the subject. Each photograph has only some small areas in focus, and these focused areas are then cut out and merged together to make one, completely focused, image.

This technology is important for phenotyping in synthetic biology using Marchantia. It is also needed in very many other areas of biology research where the subject is very tiny. For example, in trichome research in Arabidopsis.

We aim to advance the use of deep focus photography in two ways:

  1. Develop a £100 teaching tool that can be used to teach the principles of deep focus photography, and a curriculum to accompany it.

  2. Demonstrate and document how to convert the system so that it can take publishable photographs of the sort that can appear on the front cover of a journal, to be built for under £4000. Our system will accommodate subjects from 0.25mm to 1cm tall and beyond.

The Team

Dr Jennifer Deegan,
Visitor, Department of Plant Sciences, University of Cambridge

Dr Christopher Whitewoods,
Postdoctoral researcher, Cell and Developmental Biology, John Innes Centre

Dr Aleksandr Gavrin,
Research Associate, Sainsbury Laboratory, University of Cambridge

Mr Matthew Couchman,
Support Specialist, Computational and Systems Biology, John Innes Centre

Dr Richard Mortier,
University Lecturer, Computer Lab, University of Cambridge

Mr Tim Deegan,
External collaborator in the computing industry

Project Outputs

Project Report


Project Proposal

Original proposal and application


Project Resources

All resources are collated on this website. Documentation is also available on GITHUB, and youtube.

The project is also summarised in two publications: Deegan, 2017 and Deegan & Deegan 2018.

Progress July 2018: The YouTube channel, the Documentation, and the Photographs


Progress has been made in three main areas.

  • On the advice of professional educators I aimed my materials at Honours students. I created complete and detailed teaching materials on how to duplicate my photography setup, and presented it both as YouTube videos and online text documentation.

  • I have extended the photographic range of the set‐up by adding three new microscope objectives.

  • I have begun photographing the proposed range of photographic specimens. I have formed additional collaborations beyond the scope of the original grant proposal, and so am photographing a larger range of specimens even than initially envisaged.

Report and outcomes

We had three initial goals:

  1. Develop written documentation for the construction of a £100 teaching tool for focus stacking in schools and universities.

  2. Extend the x10 magnification focus stacking system to a much larger range of magnifications.

  3. Use the system to photograph my fern gametophytes, and the Arabidopsis trichomes and Utricularia gibba traps of my collaborators.

Our modified goals:

We have stuck to these aims, with some slight modification and extension in response to feedback. Our actual progress:

  1. I canvassed opinion among a wide range of educators and was given strong advice to aim my system at Honours undergraduate students. In the light of this, I modified my aim to:

    • Create comprehensive video tutorials and written documentation to allow an Honours student to duplicate my system. In the end the cost calculated was closer to £250.

    • A new website at was created as a central hub for all of the materials.

    • A simpler video was created, to explain focus stacking at secondary school and general undergraduate level.

  2. The focus stacking system has been extended so that it now works from x5 to x50 magnification.

  3. I am in the process of taking photos of fern gametophytes, Arabidopsis trichomes and Utricularia gibba traps.

Extension: Additional collaborations have been formed at the Sainsbury Laboratory, and photos of Marchantia have also been taken. I hope to form further collaborations at the Sainbury Laboratory in future. They have a lot of interesting specimens there, and have space to accommodate my setup for days or weeks at a time when I bring it to visit. Ideally I would like to find a little niche there as a volunteer in the long run.

Extension: The engineering of the system has been upgraded to improve camera shutter triggering in strong sunlight.

WEBSITE: website was created as hub for teaching materials:



Youtube “Chlorophyllosophy” channel was created.

The channel is the home of all of the videos that I created to walk Honours students through the process of building a complete duplicate of my system from scratch. A list of the videos and their contents is shown on the following pages.

1) How does focus stacking work? (8 mins)

This is aimed at a general audience and explains depth of field, and the use of multiple images with shallow depth of field to create a single composite image that is fully focused.

3) Automation of the focus stacking equipment. (5 mins)

This video shows how to add the electronic parts of the setup so that the movement of the focus stacking platform will automatically more forward in tiny increments, and so that the camera shutter will fire automatically.

5) Running the code – summary version. (5 mins)

This is a summary version of the video above. It shows how to run the computer program, in a way that enables people to use the system without necessarily needing to understand in detail how the program works internally. .

2) Setting up the focus stacking equipment. (5 mins)

This video shows how to build the physical structure of the focus stacking setup using various scavenged parts. .

4) Running the code – A detailed explanation. (14 mins)

This video shows the computer program that drives the platform forward and fires the shutter. It explains in detail how the program works so that users can modify the code to improve the results of their photography.

6) Measuring depth of field at high magnification. (8 mins)

This video explains how to measure the depth of field of a given lens setup. This is essential as the platform must not move forward in increments that are longer than the depth of field of the lens setup, otherwise blurred stripes will appear in the final photograph.

Written documentation:

This documentation gives full written instructions on how to build a duplicate copy of my focus stacking system. The written documentation shows how to drive the system using either a Raspberry Pi computer or an Arduino computer. There are also instructions on how to grow gametophyte ferns.


The GitHub pages contain full written instructions for building a duplicate copy of my focus stacking setup. Once again, instructions are given on how to drive the system using either a Raspberry Pi or an Arduino computer, and information is given about the culture and life cycle of gametophyte ferns.

  1. 2017 write‐up:

  2. 2018 write‐up:

Completed microscope setup

Additional microscope objectives have been purchased and are working well. The setup now photographs subjects at between 5x and 50 magnifications.

Photographs of plant subjects

This part of the project is still in progress as the video making really took a long time. I only started on the photography quite recently.

From my point of view, the most satisfying part of this project was providing photographs for other scientists. A big part of my work was in listening to them to understand what they needed.

Often their needs were very different from my plans, and I had to learn to change tack to do what they wanted me to do. This meant even allowing them to be the only ones to handle their specimens in my photography setup as the plants were so tiny and so precious to them. This was quite complex to accommodate as the photography setup has to be adjusted to micron‐scale degrees of accuracy.

Generally I was aiming for beauty in the photography, even if that might take months. Conversely my collaborators needed scientific accuracy and speed in getting results. I was able to accommodate that once I understood, because my system has the flexibility to handle that too.

My favourite part of the work was meeting the scientists, and hearing about their projects, and seeing their passion for their experimental subjects. I would like to do a lot more of that. I love learning about their tiny photographic subjects and seeing their enthusiasm for the structures that they study. I hope that with my photographs, they will be able to spread their enthusiasm more widely, as they will then have great photos to illustrate their stories.

Here is some feedback from my collaborators on why the images are useful:

“[The photos] will be really useful to get an idea of how cell shape changes across the trap, and to see differences between mutant and wild type plants. The traps are really curved which makes standard still images almost useless. Your setup does a lot better job than our lab light microscope.”

Christopher Whitewoods (John Innes Centre)

“Related [to] trichrome imaging, this project is about phenotyping of plant structures which are too small for fotocamera but too big for a microscope. This can seriously slow down any project like this. Your setup allows us to obtain deep focus picture and to fill this gap. I think it's a very useful phenotyping tool for researchers who work with this type of object.”

Aleksandr Gavrin (Sainsbury Laboratory)

Utricularia Gibba are more difficult because they are pond plants and have to be removed from the water before photographing. I am still working on how to produce the best result for this specimen.

I have some ideas of how to do this, but have run out of time to do the work before submitting this report, so I include my initial attempt at a photograph below. Christopher has helpfully explained to me which part of the plant he is most interested in imaging, and I hope that that will help me to target my effort better.

What were the problems?

When the OpenPlant grant was given to me, the judges asked that I should provide my documentation in video form, rather than as written material, which had been my proposed plan.

This was hugely challenging, but very enjoyable. I had never made videos before, and did not have the equipment to do it.

One of the challenges of making a video about photography is that the images in the video have to be taken very carefully, with very good composition, optics and lighting. There isn’t much mileage in making a badly photographed video about photography. I took a great deal of care over this aspect the project, and I hope that the videos are attractive to look at, as a result.

I figured out the following workarounds for some of the challenges:

  • My DSLR camera recorded the video footage.

  • In videos where the DSLR appears, I used my film SLR as a body double for the DSLR.

  • My old copy of Adobe Premiere Pro video editing software was brought back to life with help directly from the Adobe CEO’s help address (after many days of effort.)

  • My laptop is too slow to run the videos in the video editor, but they can be replayed after uploading to youtube. Uploading takes 2 hours each time, so this slowed me down a lot each time I needed to view an edited video.

  • I borrowed a good microphone to capture sound, and enjoyed layering the recordings of my voice over the recordings of the camera shutter. The film camera does not fire its shutter, so all shutter sounds are artificially added in the videos.

  • In the end I made 43 minutes of video footage. I’m really quite proud of having managed that. I hope the judges enjoy them too. If they only watch one, this is the best one:

Feedback from Outreach work

Part of the objective of this project was to enthuse other people about deep focus photography of fern gametophytes and other tiny specimens.

Two people who have seen my teaching materials and enjoyed them, wrote to say that they are also going to start gametophyte photography. Below are emails that they sent.

Contact 1)

“Hello Jennifer, group

Now I've just retired as teacher and have time to recover long time parked projects. I have some ferns, including a very nice Polypodium cambricum and I often have photographed their sporangia but never have been able to see live gametopytes. I recall your site explaining how to grow them, I plan to follow your method. What's the good time to collect the spores? Right now they begin to be mature and drop off the sporangia, is better to collect them just fresh or to let them to dry? Any other advice, please?”

Contact 2)

“Jennifer, We have many ferns in our garden & I just never realised the complexity of their life cycle! Thank you for educating me, I will have to look out for the gametophytes, are they found near the base of the sporophytes or do they spread further afield?”

Helicon Focus – Facebook group