forked from ukb-aoslo/ConeMapper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProbabilityMap_ConeLocations.m
More file actions
33 lines (25 loc) · 1.12 KB
/
ProbabilityMap_ConeLocations.m
File metadata and controls
33 lines (25 loc) · 1.12 KB
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
% Please cite this paper if you use any component of this software:
% D. Cunefare, L. Fang, R.F. Cooper, A. Dubra, J. Carroll, S. Farsiu, "Open source software for automatic detection of cone photoreceptors in adaptive optics ophthalmoscopy using convolutional neural networks," Scientific Reports, 7, 6620, 2017.
% Released under a GPL v2 license.
% David Cunefare
% 1/20/2017
function [AutPos] = ProbabilityMap_ConeLocations(Cone_Probability,params)
% Blur image
ConeMap = imgaussfilt(Cone_Probability,params.PMsigma);
% Find local maxima with sufficient height
[ConeMapMax] = imextendedmax(ConeMap,params.ExtMaxH);
% Find individual clusters
CC=bwconncomp(ConeMapMax,8);
% Choose COM for cone position
AutPos = [];
i = 1;
for iCone=1:length(CC.PixelIdxList)
ConeInd = cell2mat(CC.PixelIdxList(iCone));
ConeVals = ConeMap(ConeInd);
% Only save positions that pass threshold
if(max(ConeVals(:))>=params.PMthresh)
[Y,X] = ind2sub(size(ConeMap),ConeInd);
AutPos(i,:) = [(mean(X)) (mean(Y))];
i=i+1;
end
end