matlab/matlab-agentic-toolkit / skills-catalog/image-processing-and-computer-vision/matlab-process-images
matlab-process-images
VerifiedLoad this first for any MATLAB task involving images, photos, scans, frames, volumes, or visual data — reading, writing, filtering, enhancing, denoising, sharpening, deblurring, thresholding, segmenting, masking, detecting, counting objects, removing backgrounds, measuring, registering, stitching, aligning, cropping, resizing, or transforming. Covers image I/O (TIFF, PNG, JPEG, RAW, HDR), histograms, edge detection, color, morphology, deep learning for images, quality assessment, and 3-D volumes. Also for image problems (dark, noisy, blurry, low contrast, uneven lighting, hazy, color cast) or data exploration (folder of images). Includes medical imaging I/O (DICOM, NIfTI, NRRD, medicalVolume) and large/blocked images (blockedImage, whole-slide). Skip if the user just wants you to look at an image, with no MATLAB work. Not for Simulink video-block models, C/C++/CUDA code generation or GPU deployment of a network, or point clouds. Hyperspectral and visual inspection have sibling skills.
references/blocked-whole-slide-images.md
View on GitHub# Whole Slide Images (WSI) with OpenSlide and Bio-Formats
Whole slide images are high-resolution digital images of microscope slides used in digital pathology. They come in proprietary formats, are very large, and typically contain multiresolution image pyramids, associated images (thumbnails, macro images), and rich metadata.
The **Medical Imaging Toolbox Interface for Whole Slide Imaging File Reader** support package reads WSI files using the OpenSlide and Bio-Formats libraries and returns `blockedImage` objects. Install from Add-On Explorer.
## Choosing Between OpenSlide and Bio-Formats
| Aspect | OpenSlide | Bio-Formats |
|--------|-----------|-------------|
| **Functions** | `openslideinfo`, `openslideread` | `bioformatsinfo`, `bioformatsread` |
| **Formats** | Aperio (.svs), Hamamatsu (.vms, .ndpi), Leica (.scn), ZEISS (.czi), and others | 100+ formats (includes most OpenSlide formats) |
| **Image content** | 2-D, 8-bit RGB, multiple resolution levels, single time point | Also supports 3-D Z-stacks, multichannel fluorescence, time-lapse, multiseries |
| **When to use** | Simple, fast interface for standard 2-D digital pathology images | More complex/flexible; needed for 3-D, multichannel, time-lapse, or multiseries data |
If both libraries support your data, consider which is more commonly used in your field. Reading the same file with both can yield different results depending on format.
## Import Metadata and Image Data
```matlab
% Read metadata
info = openslideinfo(filename);
info.AssociatedImages % e.g., "macro", "thumbnail"
% Read main image data as blockedImage
bim = openslideread(filename);
% Read associated images (macro, thumbnail)
macroIm = openslideread(filename, ImageType="macro");
```
For Bio-Formats:
```matlab
info = bioformatsinfo(filename);
bim = bioformatsread(filename);
```
## Display and Explore
```matlab
imageshow(bim); % auto-selects resolution level, smooth zoom/pan
```
`imageshow` picks the resolution level based on zoom and changes levels as you zoom in/out. Supports scale bars, distance measurements, and annotation shapes via `viewer2d`.
## Downstream Processing
After importing as `blockedImage`, use standard blockedImage workflows:
- **Extract regions**: `getBlock`, `getRegion`, `gather` (with `Level` for specific resolution)
- **Blockwise processing**: `apply(bim, @fcn)` with parallel support
- **Nucleus/cell segmentation**: `cellpose` / `segmentCells2D` (see "Detect Nuclei in Large Whole Slide Images Using Cellpose" example)
- **Classification**: extract blocks via `blockedImageDatastore`, train classifiers on block features (see "Classify Tumors in Digital Pathology Images Using Cell Nucleus Morphology" example)
- **Mask-based block selection**: use `selectBlockLocations` with tissue masks to skip background blocks
## Key Examples (MATLAB Documentation)
- **Detect Nuclei in Large Whole Slide Images Using Cellpose** — Cellpose-based nucleus segmentation on WSI
- **Classify Tumors in Digital Pathology Images Using Cell Nucleus Morphology** — block-level classification workflow
- **Read Whole-Slide Images with OpenSlide** — basic import and display
----
Copyright 2026 The MathWorks, Inc.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |