-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreatedLabeledFirstImage.m
More file actions
65 lines (56 loc) · 1.87 KB
/
createdLabeledFirstImage.m
File metadata and controls
65 lines (56 loc) · 1.87 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
% create labeled images
clear all
inputfolder = 'C:\Users\tklee.WIN\research\reya_image_analysis_2010\output\';
outputfolder = 'C:\Users\tklee.WIN\research\reya_image_analysis_2010\output\finaltracks';
datafolder = 'C:\Users\tklee.WIN\research\reya_image_analysis_2010';
load('allCells.mat')
experiments = {...
'Lin Pos 101007',...
'Exports Lin neg GFP 2',...
'Osteosense 650 TPs 100927',...
'F480 1 100910',...
'f480 2 645 tps 100927',...
'Osteosense Exports',...
'VE Cadherin Exports',...
'Orig Long Full',...
'VEcad 100917'...
};
displayLimits = [...
0 60;
0 25;
20 100;
0 50;
0 40;
0 100;
0 50;
0 50;
0 50];
% loop over experiments
for j = 1:length(experiments)
% find all the cells for a given experiment
c = strcmp({cells.expt},experiments{j});
% find the first image
filelisting = dir(fullfile(datafolder,experiments{j},'*ch00*'));
filenames = {filelisting.name};
filelisting = dir(fullfile(datafolder,experiments{j},'*ch01*'));
red = {filelisting.name};
a = imread(fullfile(datafolder,experiments{j},filenames{1}));
imsize = size(a);
hf = figure('visible','off','Position',[1, 1, imsize(2), imsize(1)]);
ha = axes;
blah = zeros([imsize 3],'uint8');
blah(:,:,2) = imadjust(a,displayLimits(j,:)/255,[0 1]);
blah(:,:,1) = imread(fullfile(datafolder,experiments{j},red{1}));
imshow(blah,[0 10])
set(ha, 'Position',[0 0 1 1]);
for k = find(c)
text(cells(k).x(1),cells(k).y(1),num2str(cells(k).ID),'Color','w',...
'VerticalAlignment','Cap')
end
cdata = zbuffer_cdata(hf);
imwrite(cdata,fullfile(outputfolder,[experiments{j},'.png']),'PNG')
close(hf)
end
% use later
% filelisting = dir(fullfile(inputfolder,filebase));
% filenames = {filelisting.name};