GridSamp: An open-source Python toolbox for grid sampling.
Maarten Leemans, Christophe Bossens, Johan Wagemans
Brain and Cognition, University of Leuven (KU Leuven), Tiensestraat 102, Box 3711, 3000, Leuven, Belgium. maarten.leemans@kuleuven.be. · Brain and Cognition, University of Leuven (KU Leuven), Tiensestraat 102, Box 3711, 3000, Leuven, Belgium.
Key points
From the paper's conclusion- 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.
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.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Mapping the Design Space of Feature Sampling for Optical FlowarXiv · 2026
- Creating perceptually uniform circular shape spaces: An automated method for asymmetric naturalistic shapes.Behavior research methods · 2026
- napari-TurboBox: Interactive Multi-Viewer Bounding Box Annotation for AI-Guided Volumetric BioimagingarXiv · 2026
- pyMultiVideo: Open-source, Python-based, software for acquiring, synchronising, and compressing video from multiple camerasbioRxiv · 2026
- Graph-Regularized Estimation for Inverse Problems in Computational Optical Imaging.IEEE transactions on image processing : a publication of the IEEE Signal Processing Society · 2026
- Biologically grounded locality priors close the data gap for vision transformers in neural predictionbioRxiv · 2026