Matematisk Model for Mavesækkens Tømning - Danmarks Tekniske ...
Matematisk Model for Mavesækkens Tømning - Danmarks Tekniske ...
Matematisk Model for Mavesækkens Tømning - Danmarks Tekniske ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
46<br />
86 MATLAB kode til kantfindingsprogram<br />
47 minC = min(min(Data Tc99m)); % Calculating limits <strong>for</strong> the colormap<br />
48 maxC = max(max(Data Tc99m));<br />
49 minC2 = min(min(Data In111));<br />
50 maxC2 = max(max(Data In111));<br />
51<br />
52 figure<br />
53 subplot(2,2,1)<br />
54 plot ven data(Data Tc99m) % Plotting raw Tc99m data.<br />
55 title('Original Tc99m');<br />
56 xlabel('Horizontal [mm]'); ylabel('Vertical [mm]');<br />
57 subplot(2,2,2)<br />
58 plot ven data(S Tc99m) % Plotting the stomach from Tc99m data.<br />
59 title('Stomach Tc99m');<br />
60 xlabel('Horizontal [mm]'); ylabel('Vertical [mm]');<br />
61 caxis([minC,maxC]);<br />
62 subplot(2,2,3)<br />
63 plot ven data(Data In111) % Plotting raw In111 data.<br />
64 title('Original In111');<br />
65 xlabel('Horizontal [mm]'); ylabel('Vertical [mm]');<br />
66 subplot(2,2,4)<br />
67 plot ven data(S In111) % Plotting the stomach from In111 data.<br />
68 title('Stomach In111');<br />
69 xlabel('Horizontal [mm]'); ylabel('Vertical [mm]');<br />
70 caxis([minC2,maxC2]);<br />
71 print('−depsc', '−tiff', ['subplot tid' num2str(TID)])<br />
72 print('−djpeg', '−loose', ['subplot tid' num2str(TID)])<br />
73<br />
74 C = [time min; c Tc; c In]; % Returning number of counts from Tc99m<br />
75 % and In111 and time instance.<br />
Listing A.3: find border.m<br />
1 function Borderline = find border(Data)<br />
2 % This function finds the position of the stomach.<br />
3 % Data − A matrix containing a set of data from a stomach−examination<br />
4 % with gamma−cameras.<br />
5 % The call to the function is: find border(Data).<br />
6 % Copyrigth Sabrina Wendt, DTU, 31/3−2009<br />
7<br />
8<br />
9 si = 58; % Stomach Index, describes the lower bondary of the stomach.<br />
10 cs = (1/15)*max(max(Data(1:si,:))); % Count Sensivity, depends on maximal<br />
11 % number of counts in that image.<br />
12<br />
13 if cs == 0 % To awoid getting 0 counts when the Count Sensitivity is<br />
14 % very low.<br />
15 cs = 1;<br />
16 end<br />
17<br />
18 LD = length(Data);<br />
19 Borderline = zeros(LD);<br />
20 <strong>for</strong> i = 1:1:si<br />
21 <strong>for</strong> j = 1:1:LD