-
Notifications
You must be signed in to change notification settings - Fork 9
/
calculate_bp_pinhole.php
621 lines (501 loc) · 21.4 KB
/
calculate_bp_pinhole.php
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
<?php
// This file is part of the Huygens Remote Manager
// Copyright and license notice: see license.txt
use hrm\Nav;
require_once dirname(__FILE__) . '/inc/bootstrap.php';
session_start();
if (!isset ($_SESSION['user']) || !$_SESSION['user']->isLoggedIn()) {
header("Location: " . "login.php");
exit ();
}
$params = array("d", "na", "wl", "mo", "msys");
$reportparams = array("micro", "d", "na", "wl", "mo", "msys", "c");
// What follows is a mini-database of microscope models with the necessary known
// parameters.
// Developers adding a new microscope model should see the usage of these
// parameters at
// https://svi.nl/index.php?edit=ReportOtherMicroscope
// It is not easy because originally this was not to be included in HRM but
// online on the SVI server. Popular demand convinced us to include it embedded
// in HRM but without much time to make this more programmer-friendly.
// Still it is easier than it looks, so please just read the linked
// instructions.
// Or even better, just report the new model to SVI and we will include online
// and in HRM, for the benefit of all users:
// https://svi.nl/ReportOtherMicroscope
$microscopes = array(
"Biorad MRC 500, 600 and 1024" =>
array("micro=Biorad_MRC_500_600_1024¶m=Pinhole+diameter+(mm)&a=1&b=0&na=0&wl=0&msys=53.2&c=0.5&u=-3&cmsys=1&extra1=1.25&txt1=Fluorescence+attachment&extra2=1.25&txt2=DIC+attachment", "https://svi.nl/BioradMRC_500_600_1024"),
"Biorad Radiance" =>
array("micro=Biorad_Radiance¶m=Pinhole+diameter+(mm)&a=1&b=0&na=0&wl=0&msys=73.2&c=0.5&u=-3&cmsys=1&extra1=1.25&txt1=Fluorescence+attachment&extra2=1.25&txt2=DIC+attachment", "https://svi.nl/Biorad_Radiance"),
"Leica confocal TCS 4d (parameter P_8)" =>
array
("micro=Leica_TCS4d_P8¶m=Reported+parameter+(P_8)&a=2.39216&b=20&na=0&wl=0&msys=4.5&c=0.56419&u=-6",
"https://svi.nl/LeicaConfocal_TCS4d_SP1_NT"),
"Leica confocals TCS 4d, SP1 and NT (Airy disk units)" =>
array
("micro=Leica_TCS4d_SP1_NT_Airy_units¶m=Number+of+Airy+disks&msys=0&mo=0&c=0.56419&a=0&b=0&u=0&wl=580",
"https://svi.nl/LeicaConfocal_TCS4d_SP1_NT"),
"Leica confocal SP2" =>
array("micro=Leica_TCS_SP2_Airy_units¶m=Number+of+Airy+disks&msys=0&mo=0&c=0.56419&a=0&b=0&u=0&wl=580", "https://svi.nl/LeicaConfocal_TCS_SP2"),
"Leica confocal SP5" =>
array("micro=Leica_TCS_SP5_Airy_units¶m=Number+of+Airy+disks&msys=0&mo=0&c=0.56419&a=0&b=0&u=0&wl=580", "https://svi.nl/LeicaConfocal_TCS_SP5"),
"Leica confocal SP8" =>
array("micro=Leica_TCS_SP8_Airy_units¶m=Number+of+Airy+disks&msys=0&mo=0&c=0.56419&a=0&b=0&u=0&wl=580", "https://svi.nl/LeicaConfocal_TCS_SP8"),
"Nikon TE2000-E with the C1 scanning head" =>
array("micro=Nikon_TE2000E_C1¶m=Pinhole+diameter+(microns)&a=1&b=0&na=0&wl=0&msys=1&c=0.5&u=-6&extra1=1.5&txt1=Optional+1.5x+magnification",
"https://svi.nl/Nikon_TE2000E_C1"),
"Nikon TE2000-E with the C2 scanning head" =>
array("micro=Nikon_TE2000E_C2¶m=Pinhole+diameter+(microns)&a=1&b=0&na=0&wl=0&msys=1&c=0.5&u=-6&extra1=1.5&txt1=Optional+1.5x+magnification",
"https://svi.nl/Nikon_TE2000E_C2"),
"Nikon A1, A1 Plus, A1HD25, A1RHD25, AX, AXR" =>
array("micro=Nikon_A_Series¶m=Pinhole+diameter+(microns)&a=1&b=0&na=0&wl=0&msys=1&c=0.456&u=-6", "https://svi.nl/Nikon_A_Series"),
"Olympus FV10i" =>
array("micro=Olympus_FV10i¶m=Pinhole+side+(microns)&a=1&b=0&na=0&wl=0&msys=3.8&c=0.399&u=-6", "https://svi.nl/Olympus_FV10i"),
"Olympus FV300 and FVX" =>
array("micro=Olympus_FV300¶m=Reported+pinhole+parameter&table=1&a=1&b=0&na=0&wl=0&msys=3.426&c=0.5&u=-6", "https://svi.nl/Olympus_FV300"),
"Olympus FV500" =>
array("micro=Olympus_FV500¶m=Pinhole+side+(microns)&a=1&b=0&na=0&wl=0&msys=3.8&c=0.5641896&u=-6", "https://svi.nl/Olympus_FV500"),
"Olympus FV1000" =>
array("micro=Olympus_FV1000¶m=Pinhole+side+(microns)&a=1&b=0&na=0&wl=0&msys=3.82&c=0.5641896&u=-6", "https://svi.nl/Olympus_FV1000"),
"Olympus FV3000" =>
array("micro=Olympus_FV3000¶m=Pinhole+side+(microns)&a=1&b=0&na=0&wl=0&msys=7.6&c=0.5641896&u=-6", "https://svi.nl/Olympus_FV3000"),
"Yokogawa spinning disk - pinhole RADIUS - all CSU models" =>
array("micro=Yokogawa_spinning_disk&d=50&a=1&b=0&na=0&wl=0&msys=1&c=0.5&u=-6",
"https://svi.nl/YokogawaDisk"),
"Yokogawa spinning disk - pinhole DISTANCE - CSU-10, CSU-22, CSU-X1" =>
array("micro=Yokogawa_disk_(pinhole_distance)&d=253&a=1&b=0&na=0&wl=0&msys=1&c=1&u=-6&ru=-6&rtag=pinhole+distance",
"https://svi.nl/BackProjectedPinholeDistance"),
"Yokogawa spinning disk - pinhole DISTANCE - CSU-W1" =>
array("micro=Yokogawa_disk_(pinhole_distance)&d=253&a=1&b=0&na=0&wl=0&msys=0.5065&c=1&u=-6&ru=-6&rtag=pinhole+distance",
"https://svi.nl/BackProjectedPinholeDistance"),
"Visitech Infinity spinning disk - pinhole RADIUS" =>
array("micro=Visitech_spinning_disk&d=50&a=1&b=0&na=0&wl=0&msys=1&c=0.5&u=-6",
"https://svi.nl/Visitech_Infinity"),
"Visitech Infinity spinning disk - pinhole DISTANCE" =>
array("micro=Visitech_disk_(pinhole_distance)&d=253&a=1&b=0&na=0&wl=0&msys=1&c=1&u=-6&ru=-6&rtag=pinhole+distance",
"https://svi.nl/BackProjectedPinholeDistance"),
"Zeiss LSM410 inverted" =>
array("micro=Zeiss_LSM410_inverted_P8¶m=Reported+parameter+(P_8)&a=3.92157&b=0&na=0&wl=0&msys=2.23&c=0.56419&u=-6",
"https://svi.nl/Zeiss_LSM410_inverted"),
"Zeiss LSM510" =>
array("micro=Zeiss_LSM510¶m=Pinhole+diameter+(microns)&a=1&b=0&na=0&wl=0&msys=3.33&c=0.5&u=-6", "https://svi.nl/Zeiss_LSM510"),
"Zeiss LSM700" =>
array("micro=Zeiss_LSM700¶m=Pinhole+diameter+(microns)&a=1&b=0&na=0&wl=0&msys=1.53&c=0.564&u=-6", "https://svi.nl/Zeiss_LSM700"),
"Zeiss LSM710" =>
array("micro=Zeiss_LSM710¶m=Pinhole+diameter+(microns)&a=1&b=0&na=0&wl=0&msys=1.9048&c=0.564&u=-6", "https://svi.nl/Zeiss_LSM710"),
"Zeiss LSM780" =>
array("micro=Zeiss_780¶m=Pinhole+diameter+(microns)&a=1&b=0&na=0&wl=0&msys=1.9048&c=0.564&u=-6", "https://svi.nl/Zeiss_LSM780"),
"Zeiss LSM800" =>
array("micro=Zeiss_800¶m=Pinhole+diameter+(microns)&a=1&b=0&na=0&wl=0&msys=1.53&c=0.564&u=-6", "https://svi.nl/Zeiss_LSM800"),
"Zeiss LSM880" =>
array("micro=Zeiss_800¶m=Pinhole+diameter+(microns)&a=1&b=0&na=0&wl=0&msys=1.9048&c=0.564&u=-6", "https://svi.nl/Zeiss_LSM880"),
"Not listed" =>
array("micro=Not_listed_microscope¶m=Pinhole+physical+diameter+(microns)&a=1&b=0&na=0&wl=0&u=-6", "https://svi.nl/ReportOtherMicroscope")
);
function globalize_vars($var_string, $type)
{
global ${$type};
if ($var_string && $type) {
$var_name = trim(strtok($var_string, ","));
global ${$var_name};
if (!isset(${$var_name}) && isset(${$type}["$var_name"]))
${$var_name} = ${$type}["$var_name"];
#echo $var_name, $$var_name, " ";
while ($var_name) {
$var_name = trim(strtok(","));
global ${$var_name};
if (!isset(${$var_name}) && isset(${$type}["$var_name"]))
${$var_name} = ${$type}["$var_name"];
}
}
}
// Parameters passed by _GET or _POST that are dumped in global variables:
$post_string = "param, micro, d, a, b, c, u, wl, na, mo, msys, task, ref, " .
"cmsys, extra1, extra2, table, txt1, txt2, checked1, checked2, " .
"help, ru, rtag";
globalize_vars($post_string, "_POST");
globalize_vars($post_string, "_GET");
if (!isset($ref) || $ref == "")
$ref = "capturing_parameter.php";
if (!isset($ru) || $ru == "") $ru = "-9";
// Units of the input parameter
switch ($u) {
case 0:
$units = "(m)";
break;
case -3:
$units = "(mm)";
break;
case -6:
$units = "(µm)";
break;
case -9:
$units = "(nm)";
break;
default:
$units = "";
break;
}
// Units of the reported parameter
switch ($ru) {
case 0:
$runits = "(m)";
break;
case -3:
$runits = "(mm)";
break;
case -6:
$runits = "(µm)";
break;
case -9:
$runits = "(nm)";
break;
default:
$runits = "";
break;
}
if (!isset($rtag) || $rtag == "") {
$rtag = "pinhole radius";
}
if ($param == "") $param = "Reported parameter $units";
$Label = array("micro" => "Microscope model",
"d" => $param,
"wl" => "Wavelength (nm)",
"na" => "Lens numerical aperture",
"mo" => "Objective magnification",
"msys" => "Internal system magnification",
"c" => "Shape factor"
);
$Default = array("micro" => "Not specified",
"d" => "",
"wl" => "590",
"na" => "1.3",
"mo" => "100",
"msys" => "1",
"c" => "0.5"
);
function field($p)
{
global $Label, $WikiURL, $WikiArticle;
#$string = " <a target=\"SviWiki\" href=\"".$WikiURL.$WikiArticle[$param]."\">";
$string = $Label[$p];
#$string .= "</a> ";
return $string;
}
function fieldEntry($p)
{
global $Details, $Default;
global ${$p};
if (isset($$p)) $val = $$p;
else $val = $Default[$p];
$string = field($p);
$string .= "<input type=\"text\" " .
"name=\"$p\" size=\"5\" value=\"" .
$val . "\">";
#$string .= "<td>".$Details[$param]."</td>";
return $string;
}
# --
function start() {
global $microscopes, $na;
echo "<h4>Please choose a microscope from the following list:</h4>";
echo "\n<ul>";
$script = $_SERVER['PHP_SELF'];
foreach ($microscopes as $m => $data) {
$extra = "";
// If na is not defined in the model parameters take the one reported
// from HRM.
if (!strstr($data[0], "na=") && isset($na) && $na != "") {
$extra = "&na=$na";
}
echo "\n<li><a href=\"$script?$data[0]&help=$data[1]&task=form$extra\">$m</a></li>";
}
echo "\n</ul>";
echo "<div id=\"controls\">
<input type=\"button\" value=\"\" class=\"icon up\"
onmouseover=\"Tip('Go back without calculating the ' +
'backprojected pinhole radius for your microscope.')\"
onmouseout=\"UnTip()\"
onclick=\"document.location.href='capturing_parameter.php'\" /></div>";
echo "\n</div> <!-- content -->\n";
?>
<div id="rightpanel">
<div id="info">
<h3>Quick help</h3>
<?php
echo "<p>The following forms will assist you in calculating the " .
"(circular-equivalent) backprojected pinhole radius expressed in " .
"nanometers, that you can enter directly in the HRM settings.</p>";
echo "<p>Please mind that there is one special entry to calculate ";
echo "pinhole distances in spinning disks.</p>";
echo "<p>Click <b>Help</b> on the top menu for more details.</p>";
echo "<p>Start by selecting your microscope model from the list on the
left, or click on cancel at the bottom to go back.</p>";
echo "</div>";
echo "</div>";
}
function form($error = false, $imglink = "") {
global $params, $reportparams, $ref, $help, $rtag, $ru;
global $a, $b, $c, $d, $u, $param, $wl, $na, $mo, $msys, $micro, $units;
global $cmsys, $table, $extra1, $txt1, $extra2, $txt2, $checked1, $checked2;
// Initialize message
$message = "";
if ($error) print $error . "<br><br>";
print "\n<h3>" . str_replace("_", " ", $micro) . "</h3>";
print "\n<form action=\"calculate_bp_pinhole.php\" method=\"post\"" .
" id=\"select\">";
print "\n<fieldset class=\"setting\">";
print "\nEnter the parameters as reported by your microscope:";
print "\n<INPUT TYPE=\"hidden\" name=\"task\" value=\"calc\">";
print "\n<INPUT TYPE=\"hidden\" name=\"ref\" value=\""
. $ref . "\">";
print "\n<INPUT TYPE=\"hidden\" name=\"param\" value=\""
. $param . "\">";
#print "\n<INPUT TYPE=\"hidden\" name=\"micro\" value=\""
#.$micro."\">";
print "\n<INPUT TYPE=\"hidden\" name=\"a\" value=\""
. $a . "\">";
print "\n<INPUT TYPE=\"hidden\" name=\"b\" value=\""
. $b . "\">";
# print "\n<INPUT TYPE=\"hidden\" name=\"c\" value=\""
#.$c."\">";
print "\n<INPUT TYPE=\"hidden\" name=\"u\" value=\""
. $u . "\">";
print "\n<INPUT TYPE=\"hidden\" name=\"ru\" value=\""
. $ru . "\">";
print "\n<INPUT TYPE=\"hidden\" name=\"rtag\" value=\""
. $rtag . "\">";
print "\n<INPUT TYPE=\"hidden\" name=\"table\" value=\""
. $table . "\">";
print "\n<br><br>";
$afterTable = "";
foreach ($reportparams as $entry) {
if (!isset($$entry) && $$entry !== "" && $$entry !== 0
|| ($entry == "msys" && $cmsys == 1)
) {
print fieldEntry($entry) . "<br>\n";
} else
$afterTable .= "\n<INPUT TYPE=\"hidden\" name=\"" . $entry .
"\" value=\"" . $$entry . "\">";
}
if (isset($extra1) && isset($txt1)) {
print (urldecode($txt1));
print ("\n<input type=\"checkbox\" name=\"extra1\" value=\"$extra1\"" .
" $checked1><br>"); #checked
}
if (isset($extra2) && isset($txt2)) {
print (urldecode($txt2));
print ("\n<input type=\"checkbox\" name=\"extra2\" value=\"$extra2\"" .
" $checked2><br>"); #checked
}
print "<div><input name=\"OK\" type=\"hidden\" /></div>";
print "\n$afterTable";
?>
</fieldset>
<div id="controls">
<input type="button" value="" class="icon previous"
onmouseover="Tip('Go back to the microscope list.' )"
onmouseout="UnTip()"
onclick="document.location.href='<?php echo $_SERVER['PHP_SELF']; ?>'"/>
<input type="submit" value="" class="icon calc"
onmouseover="Tip('Calculate the backprojected pinhole ' +
'radius or distance from the entered parameters.' )"
onmouseout="UnTip()"
onclick="process()"/>
</div>
</form>
</div> <!-- content -->
<div id="rightpanel">
<div id="info">
<h3>Quick help</h3>
<p>
Enter or confirm the requested values and press the calculator
button to calculate the
<a href="javascript:openWindow('
https://svi.nl/BackProjected')">
back projected
</a>
pinhole radius.
Press the back button to go back to the list of microscopes.
</p>
<p>
Read more about the
<a href="javascript:openWindow('<?php echo $help; ?>')">
<?php echo $micro; ?></a> model.
</p>
</div>
<div id="message">
<?php
echo "<p>$message</p>";
?>
</div>
</div> <!-- rightpanel -->
<?php
} # END form
# --
function serve()
{
global $a, $b, $c, $d, $u, $param, $wl, $na, $mo, $msys, $micro;
global $extra1, $extra2, $table, $ru, $runits, $rtag;
global $ref, $params, $Label, $Default, $reportparams;
$warning = NULL;
$out = "";
$error = "";
foreach ($params as $entry) {
# $out .= $entry. " ". $$entry."<br>\n";
if (!isset($$entry) || $$entry == "" || $$entry < 0) {
$$entry = $Default[$entry];
$warning .= "\n<br>Using default value " . $$entry .
" for " . $Label[$entry] . " " . $entry;
}
}
if (($mo == 0 || $msys == 0) && ($na == 0 && $wl == 0)) {
$error .= "Wrong magnification value.<br>\n";
} else {
$M = $mo * $msys;
if ($extra1) $M *= $extra1;
if ($extra2) $M *= $extra2;
}
if ($c == 0)
$error .= "Wrong shape factor value.<br>\n";
if ($d == 0 || !isset($d))
$error .= "Wrong pinhole value. Please enter a value as reported " .
"by your microscope.<br>\n";
if ($table == 1) {
if ($micro == "Olympus_FV300") {
switch ($d) {
case 1:
$deff = 60;
break;
case 2:
$deff = 100;
break;
case 3:
$deff = 150;
break;
case 4:
$deff = 200;
break;
case 5:
$deff = 300;
break;
default:
$error .= "Unknown size parameter";
break;
}
} else $error .= "Undefined table for model $micro<br>\n";
} else {
$deff = $d;
}
#$out .= "d $deff";
if ($na != 0 && $wl != 0) { # Reported in Airy disks
$phr = $c * 1.22 * $wl * $deff / $na;
$M = 1; #Magnification doesn't apply in this case, don't divide at all.
} elseif ($a != 0) {
if (!is_numeric($ru)) {
$error .= "Wrong report units value $ru.<br>\n";
}
if (is_numeric($u)) {
$unitsf = pow(10, $u);
$phr = pow(10, -1 * $ru) * $unitsf * $c * ($a * $deff + $b);
#$out .= "rb = ".pow(10,9) * $unitsf." * $c * ($a * $deff plus $b)<br>";
} else
$error .= "Wrong units value $u.<br>\n";
} else {
$error .= "Wrong equation: not enough parameters.<br>\n";
}
if ($error) {
$out .= "<h3>Error!</h3>\n" . $error;
} else {
$out .= "<p>Parameters used for the calculation:</p>";
$out .= $warning;
$out .= "<p>";
$out .= "" . field("micro") . ": " . $micro . " ";
foreach ($reportparams as $entry) {
if ($$entry != 0 && isset($$entry)) {
$out .= "\n<br>" . field($entry) . ": " . $$entry . " ";
if ($entry == "msys") {
if ($extra1) $out .= "×$extra1 ";
if ($extra2) $out .= "×$extra2 ";
}
}
}
$out .= "</p>\n";
$out .= "<p> </p>";
$result = round($phr / $M, 2);
$out .= "<fieldset id='backproj_result'>";
$out .= "<legend>Result</legend>";
$out .= "Backprojected $rtag $runits: <em class='result_value'>$result</em>";
$out .= "</fieldset>";
}
$out .= "<div id=\"controls\">";
$toScript = $_SERVER['HTTP_REFERER'];
$out .= "<input type=\"button\" value=\"\" class=\"icon previous\"
onmouseover=\"Tip('Try again with other parameters.' )\"
onmouseout=\"UnTip()\"
onclick=\"document.location.href='" . $toScript . "'\" />";
$out .= "<input type=\"button\" value=\"\" class=\"icon next\"
onmouseover=\"Tip('Proceed to the optical parameters back.' )\"
onmouseout=\"UnTip()\"
onclick=\"document.location.href='" . $ref . "'\" /></div>";
$out .= "</div> <!-- content -->";
$out .= "<div id=\"rightpanel\">
<div id=\"info\">
<h3>Quick help</h3>";
if ($error) {
$out .= "<p>Please go back and correct the wrong or missing parameter(s) or
proceed to the optical parameter pages.</p>";
} else {
$out .= "<p>On the left you can see the result of the calculation and the
parameters used for it. <u>Please annotate the calculated value
and enter it in the image parameter pages. The value <strong>
will not</strong> be transferred automatically</u>.</p>
<p>You can repeat the calculation with different input values
(e.g. for other channels) or proceed to the image parameter
pages.</p>";
}
$out .= "</div>
</div> <!-- rightpanel -->";
return $out;
} # END calc
# --
############ Start page
$script = "settings.js";
include("header.inc.php");
?>
<div id="nav">
<div id="navleft">
<ul>
<?php
echo(Nav::linkWikiPage('BackprojectedPinholeCalculator'));
?>
</ul>
</div>
<div id="navright">
<ul>
<?php
echo(Nav::textUser($_SESSION['user']->name()));
?>
</ul>
</div>
<div class="clear"></div>
</div>
<?php
echo "<div id=\"content\"><h3><img alt=\"CalcPinhole\" src=\"./images/pinhole.png\"
width=\"40\"/> Backprojected pinhole calculator</h3>";
switch ($task) {
case 'calc':
$html = serve();
echo $html;
break;
case 'form':
form();
break;
default:
start();
# this case doesn't print html headers, it is intended to be called from
# a wiki article by inserting %%Nyquistcalculator%% there.
}
include("footer.inc.php");
?>