-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplotIntensitySizeFilter.m
34 lines (31 loc) · 1.17 KB
/
plotIntensitySizeFilter.m
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
32
33
function [ ] = plotIntensitySizeFilter(blobFeats,pixelsize,intensityThreshold,maxBlobSize,figurename)
% makes a diagnostic plot of the joint distribution of blob intensity and
% size for purposes of filtering tracked objects
exportOptions = struct('Format','eps2',...
'Color','rgb',...
'Width',10,...
'Resolution',300,...
'FontMode','fixed',...
'FontSize',12,...
'LineWidth',1);
SIfig = figure;
histogram2(blobFeats.intensity_mean,blobFeats.area*pixelsize^2,...
'DisplayStyle','tile','EdgeColor','none','YBinLimits',[0 2*maxBlobSize])
ylabel('area (\mum^2)')
hold on
plot(intensityThreshold*[1 1],[0 maxBlobSize],'r--')
plot([intensityThreshold 255],[maxBlobSize maxBlobSize],'r--')
yyaxis right
histogram(blobFeats.intensity_mean,'DisplayStyle','stairs','Normalization','Probability')
ylabel('P')
xlabel('pixel intensity')
title(figurename,'FontWeight','normal')
if ~isempty(figurename)
set(SIfig,'PaperUnits','centimeters')
filename = ['figures/diagnostics/sizeVintensity_' strrep(figurename,' ','_')];
exportfig(SIfig,[filename '.eps'],exportOptions)
system(['epstopdf ' filename '.eps']);
system(['rm ' filename '.eps']);
end
close(SIfig)
end