SciRS2 NDImage - Production Ready Image Processing
Production-ready multidimensional image processing for the SciRS2 scientific computing ecosystem (v0.1.4). Following the SciRS2 POLICY, this module delivers a comprehensive, high-performance toolkit for n-dimensional image processing with full SciPy ndimage API compatibility, ecosystem consistency, and optimization for enterprise and research applications.
🚀 Production Status
Version 0.1.0 (SciRS2 POLICY & Enhanced Performance) - Production-grade stability with ecosystem consistency:
- ✅ 142 unit tests + 39 doctests - 100% passing
- ✅ Zero warnings - Strict code quality standards
- ✅ Performance optimized - SIMD and parallel processing
- ✅ Memory efficient - Handles large datasets seamlessly
- ✅ Type safe - Leverages Rust's compile-time guarantees
🎯 Key Features
🔧 Comprehensive Functionality
- Filters: N-dimensional Gaussian, median, rank, edge detection (Sobel, Prewitt, Laplace, Canny)
- Morphology: Binary/grayscale operations, distance transforms, hit-or-miss transforms
- Measurements: Region analysis, moments (raw, central, normalized, Hu), statistical measures
- Segmentation: Advanced thresholding (Otsu, adaptive), watershed algorithms
- Feature Detection: Corner detection (Harris, FAST), unified edge detection
- Interpolation: Spline interpolation, geometric transforms, affine transforms
⚡ Performance & Scalability
- SIMD Acceleration: Vectorized operations for maximum performance
- Parallel Processing: Multi-core optimization for large datasets
- Memory Efficiency: Optimized algorithms for minimal memory footprint
- N-Dimensional: Seamless support for 1D, 2D, 3D, and higher dimensions
🛡️ Enterprise Grade
- Type Safety: Compile-time correctness with Rust's type system
- Error Handling: Comprehensive error handling with detailed diagnostics
- API Stability: SciPy-compatible API for easy migration
- Benchmark Tested: Comprehensive performance validation
📦 Installation
Basic Installation
[]
= "0.1.4"
Production Configuration (Recommended)
For maximum performance in production environments:
[]
= { = "0.1.4", = ["parallel", "simd"] }
= "0.16" # Required for array operations
Feature Flags
parallel: Enable multi-core parallel processing (recommended for large datasets)simd: Enable SIMD vectorization for performance-critical operations- Default: Core functionality without performance optimizations
🚀 Quick Start
use ;
use Array2;
// Create test image
let image = from_shape_fn;
// Apply Gaussian filter
let filtered = gaussian_filter?;
// Apply morphological operations
let dilated = binary_dilation?;
// All operations support n-dimensional arrays seamlessly
📚 Comprehensive Examples
use ;
use ;
// Create a sample 2D image
let image = from_shape_fn;
// Apply Gaussian filter
let sigma = 1.0;
let filtered = gaussian_filter.unwrap;
// Apply rank filters (works on any dimension)
let max_filtered = maximum_filter.unwrap;
let min_filtered = minimum_filter.unwrap;
// Apply binary dilation
let struct_elem = generate_disk.unwrap;
let dilated = binary_dilation.unwrap;
// Hit-or-miss transform for pattern detection
let pattern = from_shape_vec.unwrap;
let hit_miss = binary_hit_or_miss.unwrap;
// Distance transform with multiple metrics
use IxDyn;
let image_dyn = image.clone..unwrap;
let = distance_transform_edt;
// Measure region properties
let labels = label.unwrap;
let props = regionprops.unwrap;
for region in props
// 3D example - rank filters work on any dimension
let volume = zeros;
let filtered_3d = median_filter.unwrap;
// Rotate image using spline interpolation
let rotated = rotate.unwrap;
🔧 API Reference
Filters
Image filtering functionality:
use ;
Morphology
Morphological operations:
use ;
Measurements
Measurement functions:
use ;
Segmentation
Image segmentation functions:
use ;
Features
Feature detection:
use ;
Interpolation
Interpolation functions:
use ;
📈 Performance & Benchmarks
Benchmark Suite
Production-grade performance validation with comprehensive benchmark coverage:
| Operation Category | Benchmark Coverage |
|---|---|
| Filters | Rank, generic, edge filters, boundary modes |
| Morphology | Binary/grayscale operations, distance transforms |
| Interpolation | Affine transforms, coordinate mapping, spline orders |
| Multi-dimensional | Performance scaling across 1D-3D+ dimensions |
Running Benchmarks
# Complete benchmark suite
# Category-specific benchmarks
Performance Characteristics
- SIMD acceleration: 2-4x performance improvement on supported operations
- Parallel processing: Linear scaling with CPU cores for large datasets
- Memory efficiency: Optimized algorithms minimize memory allocation
- N-dimensional scaling: Consistent performance across dimensions
Contributing
See the CONTRIBUTING.md file for contribution guidelines.
License
This project is Licensed under the Apache License 2.0. See LICENSE for details.
You can choose to use either license. See the LICENSE file for details.