-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgetLoadFrameHandleForAlternatingIllum.m
More file actions
46 lines (32 loc) · 1.16 KB
/
getLoadFrameHandleForAlternatingIllum.m
File metadata and controls
46 lines (32 loc) · 1.16 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
function h=getLoadFrameHandleForAlternatingIllum(basefilename,extension,channelPrefix,filenameDigits,findNeuronsInRed,greenChIs1,FirstImNum,LastImNum)
%Returns a function handle to a function that loads in a frame. This is
%currently qritten for dual-view images. Simply write your own loadFrame
%function here and you should be good to go.
h=@loadFrame;
function [I, ret]=loadFrame(num)
%ret is zero (false) when things worked
%ret is one (true) when out of range
currPts='';
ret=false;
if num<FirstImNum || num>LastImNum
%Out of Range
ret=true;
else
if greenChIs1
green=1;
red=2;
else
green=2;
red=1;
end
if findNeuronsInRed
channel=red;
else
channel=green;
end
%Load in a frame
I=imread(getFileName(num,basefilename,[ channelPrefix num2str(channel) extension],filenameDigits));
ret=false; %We are in range
end
end
end