-
Notifications
You must be signed in to change notification settings - Fork 0
/
fetch-by-anatomical-region.php
executable file
·65 lines (59 loc) · 2.01 KB
/
fetch-by-anatomical-region.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
<?php
require $_SERVER['DOCUMENT_ROOT'] . '/lib/rdf-db.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/lib/misc.php';
//the "yes" flag specifies that the term should have hyperlinks to source URL
$terms = get_conte_terms_hash("yes");
$region = $_REQUEST['region'];
//$data = get_stat_by_region($region);
$arr = get_stat_by_region($region);
$data = $arr['data'];
$query = $arr['query'];
$query = str_replace("<", "<", $query);
$query = str_replace(">", ">", $query);
?>
<div style="float:right;">Toggle SPARQL Query <input style="vertical-align:middle;" type="checkbox" id="toggle_switch" onclick="toggleSPARQL();" /> </div>
<br />
<div id='sparql_query' style='display:none;'><pre><?php echo $query; ?></pre> </div>
<?php
$numrows = count($data);
echo "$numrows entries found.";
//var_dump($data);
//exit;
echo '<div style="max-height: 400px; overflow-y: auto; clear: both;">';
echo '<table class="gridtable">';
echo '<thead><tr>';
echo '<th title="' . $terms['subjectID'] . '">Subject ID</th>';
echo '<th>Region</th>';
echo '<th>SegID</th>';
echo '<th>Volume (mm<sup>3</sup>)</th>';
echo '<th>Voxels</th>';
echo '<th>normMax</th>';
echo '<th>normMin</th>';
echo '<th>normMean</th>';
echo '<th>Range</th>';
echo '<th>StdDev</th>';
echo '</tr></thead>';
echo '<tbody>';
for($ri = 0; $ri < $numrows; $ri++) {
echo '<tr>';
$row = $data[$ri];
//var_dump($row);
list($iri, $region) = split('#', $row['region']);
$mean = round( $row['mean'], 1, PHP_ROUND_HALF_UP);
$stddev = round( $row['stddev'], 1, PHP_ROUND_HALF_UP);
echo "<td>".$row['subject']."</td>";
echo "<td>".$region."</td>";
echo "<td>".$row['segID']."</td>";
echo "<td>".$row['volume']."</td>";
echo "<td>".$row['nvoxel']."</td>";
echo "<td>".$row['max']."</td>";
echo "<td>".$row['min']."</td>";
echo "<td>".$mean."</td>";
echo "<td>".$row['range']."</td>";
echo "<td>".$stddev."</td>";
echo '</tr>';
}
echo "</tbody>";
echo "</table>";
echo "</div>";
?>