# README for Smart Stack dataset This README concerns the files on the [University of Bath archive](https://doi.org/10.15125/BATH-01063) supporting the publication ['Fast, high precision autofocus on a motorised microscope: Automating blood sample imaging on the OpenFlexure Microscope'](https://doi.org/10.1111/jmi.13064). Where relevant images or data haven't been shared, they are too large to be archived here, and will be properly described and archived in the future with an associated publication. All code is written on Python 3.8.2, and requires the hosted `requirements.txt` packages to be installed and used. Other versions of Python may work if dependencies and version control are resolved. Enquiries can be directed to the authors from the details included with the publication. Each file or folder uploaded is explained here, and the paper figures it relates to are referenced and indexed at the end. ## Files and links ### requirements.txt A list of the python modules installed in the virtual environment where this code was run. ### smart_stack_processing.ipynb Jupyter notebook to take a completed smart stack folder and create a folder containing only the central images, ready to be tiled using Fiji distribution of ImageJ. Used to prepare images for Figure 7 ### comparison.ipynb Jupyter notebook to plot the JPEG and Laplacian sharpnesses of a z-stack of images. Users can use their own images or the example images used in the paper, manually judging a focused range. To recreate Figures 3 and 5, zea.zip and USAF.zip are required. The path in the fourth cell should be changed to the input folder (either `zea/8` or `USAF/11` assuming `zea.zip` and `USAF.zip` are extracted into the corresponding folders). The focused range is manually specified in the fifth cell. ### peak_plot.ipynb Jupyter notebook to produce histograms of the position of sharpest images in stacks produced by different focus methods. The underpinning images used are not included, but the results are included here as an example and to allow the notebook to plot. Used to produce Figure 8. ### z-step measurements (https://gitlab.com/jaknapper/z-step-measurements) Code, method and data for the z step size measurements. This is a live repository. ### Smart Stack algorithm (https://doi.org/10.5281/zenodo.5564503) Archived code for performing the smart stack procedure ### zea.zip Stack of images taken on the OpenFlexure Microscope of a zea seed using a 40x objective. Used with comparison.ipynb to produce Figure 3. ### USAF.zip Stack of images taken on the OpenFlexure Microscope of a USAF target corner using a 40x objective. Used with comparison.ipynb to produce Figure 5. ### tile_example.zip An example of the data generated by a smart stack scan, ready to be processed and tiled. Images are of a thick blood sample, taken on the OpenFlexure Microscope using a 100x oil immersion objective. Used with smart_stack_process.ipynb and ImageJ to produce Figure 7 ## Figure Index 1. Reproduced from another publication 2. From images captured on the OpenFlexure Microscope (not included) 3. Requires zea.zip and comparison.ipynb 4. Example images from USAF.zip 5. Requires USAF.zip and comparison.ipynb 6. Original flowchart produced for this publication 7. Requires tile_example.zip, smart_stack_processing.ipynb and ImageJ. Produced by Smart Stack algorithm 8. Produced by peak_plot.ipynb. Images not included, but results of analysis included.