-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplotProcessedImage.m
More file actions
executable file
·31 lines (22 loc) · 941 Bytes
/
plotProcessedImage.m
File metadata and controls
executable file
·31 lines (22 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function [] = plotProcessedImage(outputPath, cellInfoAllCells)
fileName = cellInfoAllCells.fileName;
adjacencyMatrixBinary = cellInfoAllCells.adjacencyMatrixBinary;
mask = cellInfoAllCells.mask;
cellLocations = cellInfoAllCells.cellLocations;
graphTypeTag = cellInfoAllCells.graphTypeTag;
writePath = strcat(outputPath, filesep, fileName, '-PROCESSED-', graphTypeTag, '.tif');
% compute cell locations and ROI boundaries from mask
maskBoundaries = bwboundaries(mask);
f = figure('Visible', 'Off');
imshow(mask, 'Border', 'Tight'); hold on;
if ~isempty(adjacencyMatrixBinary)
gplot(adjacencyMatrixBinary, cellLocations, 'y');
end
for k = 1:length(maskBoundaries)
currentBoundary = maskBoundaries{k};
plot(currentBoundary(:, 2), currentBoundary(:, 1), 'r');
text(cellLocations(k, 1), cellLocations(k, 2), num2str(k), 'FontSize', 8, 'Color', 'red');
end
saveas(f, writePath);
close(f);
end