-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfcsapplygate.m
More file actions
executable file
·31 lines (25 loc) · 932 Bytes
/
fcsapplygate.m
File metadata and controls
executable file
·31 lines (25 loc) · 932 Bytes
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
function [ datOut ] = fcsapplygate( datIn, gate)
%FCSAPPLYGATE, apply gate on datIn, and output datOut
% example of gate,
% gate.xfunc = @(x) log2(x);
% gate.yfunc = @(y) log2(y);
% gate.xcha = 'ssc';
% gate.ycha = 'fsc';
% gate.polygon = sscfscgate;
switch gate.gatemethod
case 'polygon'
datX = gate.xfunc(datIn.(gate.xcha));
datY = gate.yfunc(datIn.(gate.ycha));
gatePolygon = gate.polygon;
datOut = fcsselect ( datIn, inpolygon(datX, datY, gatePolygon(:,1), gatePolygon(:,2)) );
case 'polygonfunc'
datX = gate.xfunc(datIn.(gate.xcha));
datY = gate.yfunc(datIn.(gate.ycha));
gatefunc = gate.gatefunc;
datOut = fcsselect( datIn, gatefunc(datX, datY));
case 'range1d'
datX = gate.xfunc(datIn.(gate.xcha));
gatefunc = gate.rangefunc;
datOut = fcsselect( datIn, gatefunc(datX));
end
end