R2021b

New Features, Bug Fixes, Compatibility Considerations

Blocked Images: Create and display labeled blocked images

The polyToBlockedImage function creates a labeled blockedImage from a set of coordinates that specify the vertices of one or many ROIs.

The showlabels function shows the label data in a blockedImage over the image data in a bigimageshow object. The hidelabels function hides the labels.

DICOM: Find and set attributes in DICOM metadata

The dicomfind function finds the location and value of a target attribute in DICOM metadata. The dicomupdate function enables you to set the value of a target attribute using the location of the attribute. These functions support nested attributes.

Image Quality Metrics: Calculate SSIM metric of deep learning arrays and specify dimensions of computation

The ssim function now accepts dlarray input for deep learning applications.

This function also supports formatted data with dimension labels of 'S' (spatial), 'C' (channel), and 'B' (batch). The function returns a separate result for each index along the channel and batch dimensions.

Deep Learning: Added examples using deep neural networks

These examples show how to solve image processing problems by using deep neural networks. These examples require Deep Learning Toolbox™.

medfilt3 Function: Improved performance for small neighborhood sizes

The medfilt3 function shows improved performance for neighborhood sizes from [3, 3, 3] up to [31, 31, 31].

For example, this code is about 3x faster than in the previous release.

function timingTestMedfilt3
      load mristack;
      noisyV = imnoise(mristack,'salt & pepper',0.2);
      tic
      filteredV = medfilt3(noisyV);
      toc
end

The approximate execution times are:

R2021a: 0.24 s

R2021b: 0.08 s

The code was timed on a Windows® 10, Intel® Xeon® Gold 5220 CPU @ 2.2 GHz test system by calling the function timingTestMedfilt3.

C Code Generation: Generate code from five functions using MATLAB Coder

The list indicates the Image Processing Toolbox™ functions that have been enabled for code generation in this release. For all target platforms, this function generates C code. For a complete list of Image Processing Toolbox functions that support code generation, see Functions Supporting Code Generation.

1 If you choose the generic MATLAB Host Computer option in the MATLAB® Coder™ configuration settings, this function generates C code that uses a precompiled, platform-specific shared library. Using a shared library preserves performance optimizations in this function but limits the target to only those platforms that support MATLAB (see system requirements).

C Code Generation: Generate portable C code that has improved performance for seven functions

You can generate portable C code that has faster execution speed than in previous releases for these functions:

The optimizations include multithreading and algorithm improvements. Generating portable C code requires MATLAB Coder.

GPU Acceleration for ssim Function

R2021b adds GPU acceleration for the ssim function. GPU acceleration requires Parallel Computing Toolbox™ software and meeting the GPU computing requirements detailed here.

Thread-Based Environment: Run functions in a thread-backed pool

 Functionality being removed or changed

The Format property of the GenericImage object is not recommended

Behavior change

Starting in R2021b, the Format property of the GenericImage object is not recommended. Use the Extension property instead. If you specify the Format property using dot notation, then the value is assigned to the Extension property.