How to set multiple boundaries on the same object?
Show older comments
Hello everyone,
I'm working on a project, in which I have 5 different types of cells. Some cells can belong not to one, but many types. I want to summarize the findings by giving specific colours to different types of cells and then changing the boundary colours of cells depending to which group they belong.
F.ex. one cell belongs to groups R and group B, so it has boundary colours of red and blue respectively. There can be up to 5 boundaries around one cell as there's 5 types of cells.
What I have now (the picture shows how the outcome looks)

is just overlaying the boundaries on top of each other, making them a bit bigger, but it looks bad and it's hard to read, so I was wondering whether there's a way to maybe easily shrink the boundary, so I can make them smaller every time a cell is classified to another group.
Or maybe there's a more elegant way to visualize the outcomes? I'm open to suggestions.
imshow(RGBfusion);
boundaries = bwboundaries(binaryImage);
% binaryImage is a black white image with all the cells nuclei in brain's structure
for i = 1:length(onChannels)
hold on;
for k = 1:height(overlappingCellsSignalStruct.(NewNames{i}))
% overlappingCellsSignalStruct is a struct in which I store all
% possible types of cells (NewNames) and among others indexes
% of these cells so I can easily find them on binaryImage.
% Plot the outline.
thisBoundary = boundaries{overlappingCellsSignalStruct.(NewNames{i}).CellNo(k)};
p1 = plot(thisBoundary(:,2), thisBoundary(:,1), '-');
p1.Color = pushBtnColour{i};
p1.LineWidth = i*2;
p1.Color(4) = 0.4;
end
expandAxes(handles.ImgAxes)
hold off;
end
Answers (0)
Categories
Find more on Modify Image Colors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!