making a label/category atlas of overlapping component images

7 views (last 30 days)
I'm trying to create an atlas image from several different images that record occupancy of objects in a 3d space. Object type A would be intensity 1, object B intensity 2, etc. Currently i'm just hard writing each in succession to a single array based on index/intensity. This is working so far, but fails in the case where objects are abutting or very close, as they have probabalistic borders that overlap rather than being binary objects.
Is there a means of avoiding overlap or distributing an overlap index to its neighbors? Or perhaps just a better way of making a label atlas that avoids the problem?

Accepted Answer

Carson Purnell
Carson Purnell on 13 Sep 2023
Self-answer after topic ping:
Binarization and component analysis are distractions. If every pixel/voxel needs one and only one label, cat+max is the solution. the second output of max() gives the indices of the max values, giving full overage and straightforwardly dealing with any form of overlapping. Basic example use (vol as a cell array storing some number of 3d arrays)
%concatenate in 4th dim, zero vol is so that background is distinct from 1st vol
tmp = cat(4,zeros(size(vol{1}),vol{:}));
[~,atlas] = max(tmp,[],4); %get indices of max values in 4d array
atlas = atlas-1; %makes background 0 rather than 1

More Answers (1)

Vidip Jain
Vidip Jain on 7 Sep 2023
I understand you are trying to create an atlas image from several different images that record occupancy of objects in a 3d space.
Instead of manually assigning labels based on intensity, you can use image processing techniques to automatically generate a label atlas that accurately represents the objects. Here's a general approach to tackle this problem:
  1. Connected Component Labelling (CCL): Start by applying a connected component labelling algorithm to each of your input images. This algorithm identifies connected regions of pixels with the same intensity (object type) and assigns a unique label to each region. MATLAB's bwlabeln function can be used for 3D connected component labelling.
  2. Merge Labels from Different Images: After labelling objects in each input image separately, you may have overlapping regions with different labels. To merge labels from different images, you can create a mapping between labels in different images by comparing the spatial overlap between labelled regions. If two labelled regions overlap in multiple images, you can assign them the same label in the final atlas.
  3. Post-Processing: Depending on your specific requirements, you may need to perform additional post-processing steps. This could include removing small or noisy regions, filling gaps between objects, or smoothing object boundaries.
  4. Create the Label Atlas: Finally, create a label atlas where each voxel contains the label corresponding to the object type at that location. You can achieve this by combining the labelled regions from different images, ensuring that regions with overlapping labels are resolved appropriately.
Refer to this documentation for more information: https://www.mathworks.com/help/images/ref/bwlabeln.html

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!