matlab-process-large-images

Process large images in MATLAB using blockedImage with parallel computing and custom adapters.

995|122|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-process-large-images
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab-process-large-images
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/image-processing-and-computer-vision/matlab-process-large-images
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-process-large-images

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Working with images too large to fit in memory—such as whole-slide pathology images, GeoTIFF satellite rasters, or 3D microscopy volumes—causes standard imread workflows to fail or stall. This Skill provides patterns for out-of-core, block-by-block image processing in MATLAB using blockedImage.

Core Features & Use Cases

  • Block-based processing with apply(): Run custom functions over arbitrarily large images block by block, with border handling, masks, resume support, and parallel execution via Parallel Computing Toolbox.
  • Custom adapters and data discovery: Follow a 7-step workflow to inspect folders of TIFF slices, ImageJ hyperstacks, or multi-IFD files and write images.blocked.Adapter subclasses for unsupported formats.
  • Visualization and deep learning: Display 2D images with imageshow/viewer2d and 3D volumes with volshow/viewer3d, and build training pipelines with blockedImageDatastore and selectBlockLocations.
  • Use Case: A researcher has a 100,000 x 80,000 pixel .svs whole-slide image. Use this Skill to load it as a blockedImage, threshold a coarse level to build a tissue mask, then run nucleus detection only on tissue blocks in parallel.

Quick Start

Ask the agent to load your large TIFF or whole-slide image as a blockedImage and apply a processing function block by block with parallel execution enabled.

Frequently Asked Questions about matlab-process-large-images

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I process an image too large for memory in MATLAB?

Load the file with blockedImage, which reads only metadata, then use apply(bim, @fcn) to run your function block by block. Set UseParallel=true with Parallel Computing Toolbox to distribute blocks across workers.

How do I read whole-slide images like .svs or .ndpi in MATLAB?

Install the Medical Imaging Toolbox Interface for Whole Slide Imaging File Reader support package, then use openslideread or bioformatsread to import the file as a blockedImage. OpenSlide suits standard 2D pathology slides; Bio-Formats handles 3D, multichannel, and time-lapse data.

When should I use blockedImage instead of imread?

Use blockedImage when the image exceeds RAM, when you want parallel block processing, or when working with TIFF files over 10,000 pixels in any dimension, multi-channel data, or multi-IFD files. For small images that fit in memory, standard imread workflows are sufficient.

Does blockedImage support parallel processing?

Yes, apply() supports UseParallel=true to distribute blocks across a parallel pool when Parallel Computing Toolbox is installed. Each worker independently reads and writes different blocks, enabling parallel partial reads and writes.

How do I process a folder of TIFF slices as a 3D volume?

Write a custom images.blocked.Adapter subclass that maps each Z index to a filename and uses imread with PixelRegion for sub-slice reads. Set IOBlockSize to a sub-slice region like [4096 4096 1], then construct the blockedImage with your adapter.

Why does volshow display my volume as a solid white or black cube?

volshow assumes data ranges of [0,1] for floating-point or [0,255] for uint8, so unnormalized scientific data renders incorrectly. Normalize with percentile clipping before display, or switch to MaximumIntensityProjection or SlicePlanes rendering styles.