Extended Focus Photomicrographs

I’ve recently been asked about producing extended focus photomicrographs of pollen and other complex shaped objects, using bright field microscopy. I thought I’d write up a quick guide to doing this using the equipment we have in our laboratories. It is particularly useful when producing illustrations for publications, where a single plane of focus cannot capture all of the detail and texture of objects like pollen grains. Best results are achieved using a good quality lens on a microscope that is fully aligned using the Koehler Illumination method.

The images used here were captured using our Zeiss Ax10 Scope A.1, AxioCam Erc5s camera, Zeiss EC Plan-NEOFLUAR 100x oil-immersion objective lens, and Zeiss ZEN v3.3 software, by Tom Bishop in March 2021. The specimen is a grain of Cedrus atlantica pollen mounted in glycerol.

Cedrus atlantica pollen grain, z-stack composite image. Also available from wikicommons.

We’ll be using imageJ (here version 1.53e) and the Extended Depth of Field Plugin. imageJ only needs unzipping into an appropriate location, and the plugin file (*.jar) just needs to be saved to the folder ImageJ/plugins/ in order for it to be available in software. The examples images are available from the links below:

  1. Open imageJ (imageJ.exe) and navigate File > Import > Image Sequence... > Browse and select the directory that contains the source images. They need to be in their own directory, as imageJ will load all images in the directory.
  2. Check the images by pressing the play button in the bottom left hand corner of the image window. This will cycle through all of the images you have loaded. Try not to include images that do not contain any areas of good focus.
  3. Navigate to Plugins > Extended Depth of Field > 3D EDF and click Run. Depending on the speed of your computer, processing will take a few moments – no progress bar will appear.
  4. A few different products will appear. Close the 3-D Extended Depth of Field window and close all of the open images apart from the one titled Texture.
  5. If you want to add a scale bar, navigate to File > Open... and select the image of the scale bar.
  6. Select the straight line tool from the menu and draw a line between the ten divisions in the image.
  7. Navigate to Analyze > Set scale... and set the Known distance parameter to 100, and the Unit of length to microns. Each division is 0.01 mm, so the ten divisions are 0.1 mm, or 100 microns.
  8. Tick the Global option and select OK.
  9. Select the Texture image. Navigate Analyze > Tools > Scale Bar... and modify the parameters to your preference. The settings are previewed in the image. Click OK to continue.
  10. Save the image using File > Save As... and choose a format of your preference.

itraxR Published on CRAN

My itraxR package has been published on CRAN! This package can be used to ease the pain of working with large datasets from Itrax core scanners. It works with radiographs, colour images and the XRF element peak-area data, along with all the relevant metadata. It’s still a work in progress, with plenty of functionality to add, but it has enough finished functionality to make a first release.

The package is fully documented, but I am also writing a detailed guide for working with Itrax scanner data in R, available here. This includes recipes for creating complex, publication-quality plots.

Please get in touch if you have bug reports, feature requests or other comments. You can use the issues feature on Github, or just email.

A plot of the example data. Reference: Wynn, R. B., and B. T. Cronin. 2005. “RRS “Charles Darwin” Cruise CD166, 29 Oct – 22 Nov 2004. Sedimentary processes and deposits in the Agadir Basin and Gulf of Cadiz.” 59. Vol. 44.

Common UK Lat/Long Errors and How to Spot Them

It is not uncommon for spatial data to have formatting or parsing problems, and new users can spend an awful lot of time troubleshooting what is usually a simple problem, whereas experienced users can often spot these errors just by the nature of the faulty output. For example, those working in with geographic data for the United Kingdom know that when their data points are turning up near the Seychelles, they have transposed (swapped) the latitude and the longitude! Below is a quick map (with accompanying code) that demonstrates this.

library(tidyverse)
library(ggrepel)

points <- tibble(long = c(-2.2426, 2.2426, -2.2426, 53.4808), 
                 lat = c(53.4808, 53.4808, -53.4808, -2.2426),
                 label = c("correct", "inverted long.", "inverted lat.", "transposed lat./long."),
                 colour = c("good", "bad", "bad", "bad"))

ggplot(mapping = aes(x = long, y = lat)) + 
  geom_polygon(data = map_data("world") , 
               aes(group = group),
               fill = "grey",
               colour = "grey50") +
  geom_point(data = points, aes(colour = colour)) +
  geom_label_repel(data = points,
                            aes(label = label, colour = colour)
                            ) +
  theme(legend.position = "none")

Low Cost CO2 Display

The lab is cold and half-empty because of the current COVID-19 social distancing measures in place. These are aimed at reducing the risk associated with viral transmission by aerosols. This means reducing the number of people breathing into a given volume, and increasing the turnover of fresh air in the same volume. There are many calculations and computer simulations that have gone into developing these rules, but the basics are pretty simple – more ventilation, fewer people. In practice this is quite easy to achieve in a laboratory like ours – the three fume cabinets along one wall mean there is a high turnover, and we’ve got lots of smaller side labs.

My low cost (~$15) CO2 sensor and display unit.

A number of researchers have proposed that the CO2 concentration of a volume provides a good proxy for the overall potential risk in every-day settings, and that this presents a low-cost empirical way of managing this risk. This is because CO2 is a by-product of people breathing (breath has a CO2 concentration of around 38,000 ppm), and if a room has poor ventilation the CO2 will gradually increase. If a room is well-ventilated it will equilibrate with the outside air, usually around 400 ppm. Some have proposed that a CO2 concentration of 6001000 ppm should be aimed for, others have complex models for setting the risk level (see Peng & Jimenez, 2020).

We have many way of measuring CO2, including the Los Gatos gas analyser, The ADC IRGA, and Sarah Brown’s low-cost sensors, but I was curious to see just how cheaply it could be done. The system I have built uses a generic Arduino UNO-type board (~$2), a breadboard (<$1), a 4-segment display (<$1) and at its heart, a Winsen MH-Z19B NDIR CO2 sensor (~$12). The entire package can be made for around $15. My implementation uses the code implemented by Github user Erriez, available at Github (Erriex/ErriexMHZ19B). Before I discovered Erriez’s implementation I spend an evening learning to use Realterm to send and receive hex strings for the first time. I also added a quick way to enable the calibration mode by wiring in the pin (shown near the reset button) and adding a spare wire (in red) to short this to pin to ground. When I get a moment in the lab I’ll check it against our reference units and see how it performs.

Bicycle Running Costs

I’ve been cycling to work for three years now, and I have been asked what the benefit is. There are three:

  1. It’s cheaper; I will save £5,875 over a 5 year period compared to if I were to travel by rail.
  2. It’s quicker. I will save 125 hours (over 5 entire days) per year compared to travel by rail.
  3. It’s good for my health. It improves my core strength, muscle tone, and at 280 calories per day (≈ 1.5 pints of beer), makes it easier to balance my diet.

I have based my calculations on my records from the last three years. The bicycle cost £510 (including a cycle scheme reduction). I have spent only £75 on servicing, but have invested in my own tools to do my own where possible. Spare parts, accessories, clothing and tools have combined to cost £810 over the three years I’ve owned the bike.

Having covered 10,470 km in commuting (and another 1,360 km of riding for fun), the bike costs me less than 8 pence per km, which compares favourably to the HMRC rate for business travel by bike, which is 12 pence per km.

I should add that these costs can be reduced considerably – my bike was expensive (£680 list price), and is over-specified for commuting (because I use it for fun sometimes!). In addition, my calculations include the cost of my tools, which will last much longer than the 5 years. Also, I choose to wear sports clothing to ride (mostly because I have changing and shower facilities at work), but many would choose not to. A wiser choice of cycle for commuting would also mean lower running costs, for example by using a cycle with an enclosed drive chain; perhaps treat my costs as a higher estimate.

As for the often asked questions regarding safety, I’ll say this: my ride along a busy commuter stretch of the A6 at rush-hour every day never fails to show me examples of poor driving, with the most common offenses being drivers not paying attention (turning without signalling, creeping over ASL’s and using mobile phones), and drivers “rushing to go nowhere” (that is, speeding, performing close-passes, or undercutting only to end up in the same queue of traffic a few yards on). However, in the last three years I have never collided with a motor vehicle – I have collided at low speed with a pedestrian who ran in-front of me at a pelican crossing while I turned on a green signal (we were both absolutely fine). My good fortune so far is probably a consequence of defensive cycling and dumb luck, and I long for good quality, segregated infrastructure, but I won’t let the under-investment in road infrastructure and the poor standard of UK motorists cost me the already very real benefits of riding my bike to work every day.

Headset Mod

I’ve been window shopping for single-sided headsets for portable operating, but at £80-120 I thought of how I might make my own. I purchased a cheap headset, a copy of a military style designed to be worn under helmets, marketed for airsoft enthusiasts. It has the advantage of being cheap (about £20 including PTT adapter), lightweight, and packs up small, but needs modifying to connect to a Yaesu radio, and the microphone is found wanting.

The headset is a modified “Z-Tactical Bowman Elite II”

I had previously toyed with the idea of modifying a spare MH-31 handset by adding an electret microphone element (I might still do this), so I had a few Panasonic WM-53B capsules (these cost a few pounds each), although I imagine many cheap electret capsules are appropriate. I started by hacking open the boom and replacing the stock element with the WM-53B electret. If you are trying this mod, be sure to make a note of the polarity of of the connectors on the boom arm, as you’ll need this information when wiring it in later.

Wiring diagram for the Panasonic WM-53B

Then I opened up the PTT enclosure. This helpfully has plenty of room inside, so I removed the existing cable (designed for a Baofeng HT) and fitted a chopped up network cable RJ45 and a chopped up 3.5 mm mini-jack. I also added a 3.5 mm mini-jack socket to connect an iambic key. I connected this to the “up” and “down” keys and these can be used for CW work, although the limitations of the FT-817 means it’s actually inferior to connecting to the dedicated socket in the rear of the transceiver. I also connected the PTT using the existing button, and directly connected the microphone output to the 8 ohm transducer for the speaker.

Wiring diagram for the PTT box. You can swap the 47 nF capacitor for something larger (1 μF?) for better fidelity. Given the problems with using the UP/DOWN keyts for CW, you may wish to leave that part out completely

I then moved on to the wiring for the microphone. Usefully there is a spare 5 volt supply from the Yaesu transceiver via the RJ45 socket; with the addition of a resistor to drop this voltage it can be used to supply the electret microphone element. A DC blocking capacitor is added across the microphone elements, and optionally a capacitor can be added on the output signal to act as a high-pass filter to optimise the audio. I’ve put a large capacitor to create a thin, punchy sound optimised for SSB, but in the future I might add a switch so I can bypass this to prioritise fidelity for FM work. I need to do some work to optimise the microphone gain (and speech processor in the FT-867D), so I’ve got a dummy load in the post to help with this.

The finished product, showing the PTT (black circular button), microphone connection (white wire, terminates in RJ45 plug), headphone connection (3.5 mm jack), iambic key connection (3.5 mm socket), headset and headband. Note the U-174 (“Helicopter” or “NATO”) inline plug and socket (U-92A/U) on the headset.

Kane et al. Microplastics Paper

It’s always nice to be name checked in papers where we’ve been involved in lab or field work, and it’s even better when it’s a great paper in a top journal! For this work we assisted in the methodological development of the microplastic extraction procedure. Microplastic extraction is a complex and time-consuming process involving density separation of the material in a sample, and the nature of the sediment and depositional context and process needs careful consideration.

Kane, I. A., Clare, M. A., Miramontes, E., Wogelius, R., Rothwell, J. J., Garreau, P. and Pohl, F. (2020). Seafloor Microplastic Hotspots Controlled by Deep-Sea Circulation. In Science 30 April 2020. DOI: 10.1126/science.aba5899