GRIDR Release Notes v0.5.0ο
Release Date: 2026-01-13
Type: Major Feature Release
π― Whatβs Newο
B-Spline Interpolationο
B-Spline interpolation is now available in GRIDR, delivering smoother results than traditional linear interpolation.
Available orders: 3, 5, 7, 9, and 11.
from gridr.core.interp.interpolator import BSpline5Interpolator
# Create a B-Spline interpolator of order 5
interpolator = BSpline5Interpolator(epsilon=1e-4, mask_influence_threshold=0.001)
Important: B-Spline interpolation automatically handles masked/invalid pixels, preventing artifacts from propagating into your results.
Standalone Mode - Simplified Workflow for the Core methodο
New standalone mode makes grid resampling easier than ever! Just enable it and GRIDR automatically handles all the complex preprocessing steps:
from gridr.core.grid.grid_resampling import array_grid_resampling
result = array_grid_resampling(
src_array=image,
grid_x=target_x,
grid_y=target_y,
interpolator="cubic",
standalone=True # β Enable standalone mode
)
What standalone mode does for you:
β Computes grid metrics automatically
β Detects required source regions
β Applies padding when needed
β Performs B-Spline prefiltering
β Handles masked data correctly
No more manual data preprocessing! Perfect for quick prototyping.
Boundary Conditionsο
Control how pixels are handled at image borders with four new boundary modes:
Mode |
Description |
|---|---|
|
Repeat edge pixels |
|
Mirror at boundaries |
|
Symmetric reflection |
|
Wrap to opposite edge |
Available for both Core and Chain Grid Resampling methods!
result = array_grid_resampling(
...,
boundary_condition='reflect', # Choose your mode
standalone=True
)
Eliminates edge artifacts - No more black borders or strange values at image edges!
Grid Coordinates Shiftingο
The introduction of the grid_shift parameter now enables seamless adaptation to various grid pixel coordinate system conventions, providing greater flexibility and compatibility across different imaging tools.
from gridr.chain.grid_resampling_chain import basic_grid_resampling_chain
chain = basic_grid_resampling_chain(
...,
grid_shift=(0.5, 0.5) # Shift by half a pixel
)
π‘οΈ Improved Stability & Safetyο
Automatic Safety Checksο
GRIDR now automatically detects and prevents out-of-bounds errors when working with complex geometric transformations:
Safe handling of non-topology-preserving grids
Automatic detection of valid source regions
Enhanced Numerical Precisionο
Floating-point precision issues have been resolved, addressing potential problems with:
β Nearest-neighbor interpolation selecting wrong pixels
β Inconsistent results between the Core and the Chain resampling methods for Nearest-neighbor interpolation.
π Breaking Changesο
β οΈ Interpolator Creationο
What changed: Interpolators must now be created as Python objects before passing to the Rust core resampling functions.
Before (v0.4.x):
array_grid_resampling(..., interpolator='cubic')
Now (v0.5.0):
from gridr.core.interp.interpolator import OptimizedCubicInterpolator, get_interpolator
# Still working for python functions
interp = BilinearInterpolator()
array_grid_resampling(..., interpolator="cubic")
# New interpolator object
interp = OptimizedBicubicInterpolator()
array_grid_resampling(..., interpolator=interp)
# New helper method
interp = get_interpolator("cubic")
array_grid_resampling(..., interpolator=interp)
Why? This enables advanced features like parametrized/stateful interpolators and shared pretabulated coefficients.
π Documentation Updatesο
New Resourcesο
Theoretical Foundations - Mathematical details of grid resampling conventions
Updated Users Guide - Addition of a section to the user guide for new features
Improved Math Renderingο
Documentation now uses MathJax 3 for faster, more reliable equation rendering, and includes citation support for academic references.
π§ Migration Guideο
Updating Your Codeο
Step 1: Consider using standalone mode
# Simplify your code with standalone mode
result = array_grid_resampling(
src_array=image,
grid_x=grid_x,
grid_y=grid_y,
interpolator=interp,
standalone=True # Add this!
)
Step 2: Add boundary conditions if needed
result = array_grid_resampling(
...,
boundary_condition='reflect', # Prevent edge artifacts
standalone=True
)
π Bug Fixesο
Fixed crashes when resampling with extreme geometric transformations
Fixed nearest-neighbor interpolation precision errors
Added missing Shapely dependency
Improved notebook CSS styling for better readability
π¦ Installationο
pip install --upgrade gridr
Requirements:
Python β₯ 3.10
PyO3 β₯ 0.27.2
π¬ Need Help?ο
π Documentation: https://gridr.readthedocs.io/
π Report Issues: GitHub Issues
π‘ Discussions: GitHub Discussions