forked from ukb-aoslo/ConeMapper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDisplayMarkedImageExample.m
More file actions
43 lines (29 loc) · 1.29 KB
/
DisplayMarkedImageExample.m
File metadata and controls
43 lines (29 loc) · 1.29 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
34
35
36
37
38
39
40
41
42
43
% 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.
% Example code for Getting cone position using trained network and
% displaying it
[ cnnFloderName, cnnCalcType, isCanceled ] = SelectVersionCNN();
if isCanceled
return;
end
% Set-up MatConVNetPaths
BasePath = GetRootPath();
MatConvNetPath = fullfile(BasePath, cnnFloderName);
run(fullfile(MatConvNetPath,'matlab','vl_setupnn.m'))
% choose dataset with already trained cnn and detection parameters
DataSet = 'split detector';
% load in parameters
params = get_parameters_Cone_CNN(DataSet);
% Load in an image
ImageList = dir(fullfile( params.ImageDirValidate,['*' params.ImageExt]));
ImageList = {ImageList.name};
iFile = 32;
Image = imread(fullfile(params.ImageDirValidate,ImageList{iFile}));
% Get cone positions
[CNNPos]=GetConePosSingle(params,Image, ProbParam, cnnCalcType);
% display marked image
figure; imagesc(Image); colormap gray; axis image; axis off
hold on
scatter(CNNPos(:,1),CNNPos(:,2),40,'*','g','LineWidth',1.5);
hold off