Related Experiment Video
Updated: Aug 11, 2026

Cryo-Electron Microscopy Screening Automation Across Multiple Grids Using Smart Leginon
Published on: December 1, 2023
GridSamp: An open-source Python toolbox for grid sampling
Maarten Leemans1, Christophe Bossens2, Johan Wagemans2
1Brain and Cognition, University of Leuven (KU Leuven), Tiensestraat 102, Box 3711, 3000, Leuven, Belgium. maarten.leemans@kuleuven.be.
Abstract:
Grid sampling is widely used in vision science and computer vision to study relations between local image regions and global image structure. Regions are sampled from an image by overlaying a grid with predefined rows and columns onto an image and treating the content of a cell as an image region. By manipulating the grid properties, researchers can systematically control sampling properties such as density and the spatial arrangement of local samples. Despite its frequent use, however, grid sampling is typically implemented using ad hoc, study-specific code, limiting reproducibility, comparability across studies, and accessibility for new users. To address this gap, we introduce GridSamp, an open-source Python toolbox that standardizes and streamlines the grid sampling workflow into an intuitive and flexible workflow. GridSamp supports multiple grid types with user-defined parameters and starting positions, allows manipulation of the appearance and arrangement of sampled regions (e.g., region shape, size, swapping, and shuffling), and enables extraction of image regions either with or without surrounding context, as regions of interest or as reassembled mosaic images. We demonstrate the utility of GridSamp by reproducing stimuli used in previous experimental studies, illustrating how the toolbox facilitates transparent and reproducible stimulus generation. The source code and interactive Jupyter Notebook tutorials are freely available on GitHub, and GridSamp can be downloaded as a module from the Python Package Index.
Related Concept Videos
Sampling Plans
Random sampling is a method where each member of the population has an equal chance of being selected for the sample. It involves selecting individuals randomly, often using random number generators or lottery-type methods. For example, when analyzing the properties of a...
Random Sampling Method
Stratified Sampling Method
To choose a stratified sample, divide the population into groups called strata and then take a...
Systematic Sampling Method
Systematic sampling is one of the simplest methods...
Sampling Methods: Overview
In analytical chemistry, the choice of sampling...
Bootstrapping
