MATLAB Utilities: A Decade of Modular Problem-Solving
Open-source collection of microscopy analysis tools demonstrating incremental, organized approach to research software development
Quick Takeaways
Core Idea: Organize research code early (while you have 10 functions, not 1,000) and build foundations that enable future innovation
Philosophy: “Show your warts”—develop in the open, exposing evolution and iterations, not just the polished final result
Impact: Foundation for Hydra Image Processor and Direct 5D Viewer, used at elite research institutions and collaborating laboratories worldwide
Key Lesson: The best time to organize is before you have to—modularity compounds, each reusable function becomes foundation for the next
Timeline: Started 2013, continuous development through 2024 (11+ years), demonstrates sustained research practice
Authenticity: Public from early stages—mistakes, learning moments, and incremental improvements visible in commit history
GitHub → | MATLAB File Exchange →
The Philosophy: Building Foundations While It’s Still Easy
In 2013, I made a decision that would shape how I approach software development: I started tracking and organizing the helper functions I was building for microscopy analysis before they became a tangled mess.
This wasn’t a grand architectural vision. It was a practical choice: organize early, while it’s still easy. Track utilities modularly. Make them reusable. Document as you go.
Over a decade later, this collection has grown into the foundation that enabled Hydra Image Processor and Direct 5D Viewer.
The Challenge: Research Code vs. Research Software
Research environments create a specific software development trap:
The pressure: Get results quickly for the next paper The consequence: Write one-off scripts that solve today’s problem The accumulation: Years of copy-pasted code, modified slightly each time The cost: Bug fixes require editing dozens of files; improvements never propagate
Most researchers accept this as inevitable. I decided to resist it.
MATLAB Utilities represents a different approach: treat research code like production software from day one.
The Solution: Modular, Organized, Shared
Rather than treating utilities as disposable scripts, I organized them into a structured system:
Core Principles:
- Modular packages - Functionality grouped by purpose (image processing, file I/O, visualization, metadata handling)
- Unified interfaces - Consistent APIs across utilities (e.g., single reader function for all microscope formats)
- Version control - Track changes, enable collaboration, maintain history
- Open development - Public repository showing evolution, including mistakes and iterations
Key Utilities:
MicroscopeData Package
The centerpiece: a unified reader/writer system for microscope images.
The Problem: Each microscope vendor uses different file formats. Analysis scripts become cluttered with format-specific reading code.
The Solution: Single command loads any format:
[image, metadata] = MicroscopeData.Reader();
Metadata stored in JSON files enables consistent reading across formats. Output always returned as standardized 5-D matrix (y, x, z, channel, time) regardless of input format.
Impact: Write analysis code once, apply to any microscope data.
Additional Capabilities
Image Processing:
- Denoising algorithms optimized for microscopy noise characteristics
- Multi-scale filtering and enhancement
- Morphological operations for biological structures
File Format Support:
- TIFF (including multi-page, OME-TIFF)
- Keller Lab Block (KLB) compressed format
- Zeiss CZI, Nikon ND2, and other proprietary formats
- Integrates Bio-Formats reader under the hood for known formats
- Key advantage: Users focus on using data, not loading it—regardless of file format
Analysis Tools:
- Image registration (correcting motion/drift)
- Color unmixing for multi-fluorophore experiments
- Segmentation helpers and validation utilities
Visualization & Export:
- Web export for sharing results
- Movie creation from time-lapse data
- Interactive plotting utilities
The Impact: Foundation for Innovation
Enabling Larger Projects
These utilities became the foundation for more ambitious work:
Hydra Image Processor (2019)
- Built on data structures and interfaces from MATLAB Utilities
- Unified reading system enabled seamless GPU acceleration
- Consistent metadata handling made multi-dimensional processing reliable
Direct 5D Viewer (2018)
- Leveraged the same data formats and metadata standards
- Shared utilities reduced development time
- Consistent interfaces enabled tight integration
Dissemination Through MATLAB File Exchange
Making tools accessible matters. All three major projects posted to MATLAB File Exchange for maximum reach:
- Version 3.1.3 (December 2024)
- 22 downloads, 5.0/5.0 rating
- GPU-accelerated processing accessible to non-CUDA programmers
- Version 2.0 (December 2024)
- 9 downloads
- Interactive visualization for 2D-5D datasets
- Version 2.0.1 (December 2024)
- 20 downloads
- Over a decade of functions for microscopy data manipulation
Real-World Usage
Research Deployment:
- Used at elite research institutions for microscopy analysis workflows
- Adopted by collaborating laboratories worldwide
- Foundation for reproducible research pipelines
Educational Value:
- Shows evolution of research software over time
- Demonstrates incremental improvement approach
- Provides examples for common microscopy analysis tasks
The “Show Your Warts” Philosophy
This repository is intentionally public from the early stages—including mistakes, iterations, and learning moments.
Why Expose Imperfections?
Traditional approach: Keep code private until it’s “perfect,” then release version 1.0
My approach: Develop in the open, show the evolution
Reasoning:
- Others learn from the journey - Seeing how code improves over time teaches more than seeing only the final result
- Contributions exceed criticism - Open development invites collaboration and catches errors early
- Confidence in the process - If the code is well-structured and modular from the start, early versions aren’t embarrassing—they’re documentation
- Authentic growth - Learning is messy. Showing that messiness is honest
The risk: Exposing incomplete work might feel vulnerable
The reality: The contributions, collaborations, and improvements gained far outweigh any perceived embarrassment
Technical Details
Repository Structure
Organization: MATLAB packages (directories prefixed with +) for clean namespacing
Primary Packages:
+MicroscopeData- Unified image reading/writing+ImUtils- Image processing utilities+Registration- Drift correction and alignment+Segmentation- Cell/structure segmentation helpers+Visualization- Plotting and display functions+FileUtils- Format conversion and I/O
Source Layout: Code in src/MATLAB with per-package subdirectories
Setup Method: Uses startup.m script to automatically add packages to MATLAB path (rather than copying to MATLAB’s default folders)
- Preserves version control integration
- Enables managing multiple related repositories centrally
- Keeps installation simple and reversible
Development History
Created: July 2018 (repository), with utilities dating back to 2013 Language: MATLAB (99.6%) Contributors: Eric Wait (lead), Andrew Cohen, Mark Winter, Blair Rossetti Active Development: Ongoing maintenance and feature additions
Integration Philosophy
Rather than standalone utilities, these tools are designed to compose:
- Consistent data formats enable piping between functions
- Shared metadata structures prevent information loss
- Modular design allows mixing and matching capabilities
This compositional approach enabled rapid prototyping of complex analysis workflows.
Lessons Learned: Start Early, Stay Organized
1. Organize Before You Have To
By 2013, I already saw the pattern: small scripts duplicated and modified repeatedly. Starting the organization effort before it became overwhelming made it manageable.
Lesson: The best time to organize is when you have 10 functions, not 1,000.
2. Modularity Compounds
Each reusable function becomes the foundation for the next. The unified reader enabled more ambitious analysis. Better analysis revealed needs for better visualization. Each layer builds on previous work.
Lesson: Invest in good abstractions early—they pay dividends for years.
3. Open Development Invites Contribution
Developing publicly led to:
- Bug reports from users with different microscope types
- Contributions for file formats I didn’t have access to
- Validation that the utilities solved real problems for others
Lesson: The value of collaboration outweighs the risk of showing imperfect code.
4. Consistency Enables Integration
Using the same data structures and metadata formats across utilities made integration seamless. When building Hydra and the 5D Viewer, I didn’t fight impedance mismatches—the foundations fit naturally.
Lesson: Design for integration from the start, even if you don’t know what you’ll integrate with.
5. “Good Enough” Is Better Than “Perfect Later”
I didn’t wait until I had the perfect architecture. I started with good-enough modularity and improved iteratively.
Result: A decade of working code that enabled real research, rather than an unreleased “perfect” solution.
Lesson: Ship early, improve continuously, stay organized throughout.
The Long View: Software as a Research Practice
Most research software has a short life: written for one paper, abandoned after publication.
MATLAB Utilities represents a different model: software as a sustained research practice.
The idea: Treat your code base as a career-long asset that grows with you.
The implementation:
- Start organizing early (2013)
- Maintain consistently (2013-2025)
- Build larger projects on the foundation (Hydra 2019, 5D Viewer 2018)
- Share openly (GitHub + MATLAB File Exchange)
- Improve continuously (ongoing commits)
The outcome:
- Software that outlasts individual projects
- Capabilities that compound over time
- A portfolio demonstrating long-term commitment
- Foundations that enable ambitious future work
This isn’t about building the “perfect” utility library. It’s about demonstrating an organized, incremental, sustained approach to solving problems.
It’s about starting early, sharing openly, improving continuously, and building foundations that enable future innovation.
Links & Resources
GitHub Repository: github.com/ericwait/matlab-utilities
MATLAB File Exchange:
Related Projects:
- Hydra Image Processor - GPU-accelerated processing built on these foundations
- Direct 5D Viewer - Interactive visualization leveraging shared data structures
- Research institution work - Real-world deployment context
Technical Stack:
- MATLAB for scientific computing
- JSON for metadata standardization
- Multiple microscope format readers
- Modular package organization
How This Connects
Building Foundations: See how early organization enabled larger innovations → Hydra Image Processor and Direct 5D Viewer
“Show Your Warts” Philosophy: Explore authenticity in product development → Home page
Long-Term Excellence: Read about sustained commitment to quality → About
Modular Problem-Solving: Compare with systematic experimental design → Imaging research methodology
Research to Production: See how organized foundations enable production systems → Cancer Diagnostics Platform
Complete Journey: Learn about my path through computational science → Full Journey
This project represents more than code—it represents an approach. Start early, stay organized, share openly, and build foundations that compound over time.