volmetrics

changeset 6:e6485ef45e6e

visualize volume
author Eleni Maria Stea <elene.mst@gmail.com>
date Sat, 18 Jan 2014 01:57:52 +0200
parents 92c163c939be
children 5455c9723d9e
files data/test1.vol src/main.cc src/volume.cc src/volume.h
diffstat 4 files changed, 356 insertions(+), 21 deletions(-) [+]
line diff
     1.1 --- a/data/test1.vol	Fri Jan 17 23:45:56 2014 +0200
     1.2 +++ b/data/test1.vol	Sat Jan 18 01:57:52 2014 +0200
     1.3 @@ -3,6 +3,7 @@
     1.4  
     1.5  SLICES
     1.6  /home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0001.png
     1.7 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0002.png
     1.8  /home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0003.png
     1.9  /home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0004.png
    1.10  /home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0005.png
    1.11 @@ -17,3 +18,243 @@
    1.12  /home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0014.png
    1.13  /home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0015.png
    1.14  /home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0016.png
    1.15 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0017.png
    1.16 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0018.png
    1.17 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0019.png
    1.18 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0020.png
    1.19 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0021.png
    1.20 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0022.png
    1.21 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0023.png
    1.22 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0024.png
    1.23 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0025.png
    1.24 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0026.png
    1.25 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0027.png
    1.26 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0028.png
    1.27 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0029.png
    1.28 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0030.png
    1.29 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0031.png
    1.30 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0032.png
    1.31 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0033.png
    1.32 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0034.png
    1.33 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0035.png
    1.34 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0036.png
    1.35 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0037.png
    1.36 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0038.png
    1.37 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0039.png
    1.38 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0040.png
    1.39 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0041.png
    1.40 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0042.png
    1.41 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0043.png
    1.42 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0044.png
    1.43 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0045.png
    1.44 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0046.png
    1.45 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0047.png
    1.46 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0048.png
    1.47 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0049.png
    1.48 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0050.png
    1.49 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0051.png
    1.50 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0052.png
    1.51 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0053.png
    1.52 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0054.png
    1.53 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0055.png
    1.54 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0056.png
    1.55 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0057.png
    1.56 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0058.png
    1.57 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0059.png
    1.58 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0060.png
    1.59 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0061.png
    1.60 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0062.png
    1.61 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0063.png
    1.62 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0064.png
    1.63 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0065.png
    1.64 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0066.png
    1.65 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0067.png
    1.66 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0068.png
    1.67 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0069.png
    1.68 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0070.png
    1.69 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0071.png
    1.70 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0072.png
    1.71 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0073.png
    1.72 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0074.png
    1.73 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0075.png
    1.74 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0076.png
    1.75 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0077.png
    1.76 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0078.png
    1.77 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0079.png
    1.78 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0080.png
    1.79 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0081.png
    1.80 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0082.png
    1.81 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0083.png
    1.82 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0084.png
    1.83 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0085.png
    1.84 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0086.png
    1.85 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0087.png
    1.86 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0088.png
    1.87 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0089.png
    1.88 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0090.png
    1.89 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0091.png
    1.90 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0092.png
    1.91 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0093.png
    1.92 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0094.png
    1.93 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0095.png
    1.94 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0096.png
    1.95 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0097.png
    1.96 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0098.png
    1.97 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0099.png
    1.98 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0100.png
    1.99 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0101.png
   1.100 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0102.png
   1.101 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0103.png
   1.102 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0104.png
   1.103 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0105.png
   1.104 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0106.png
   1.105 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0107.png
   1.106 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0108.png
   1.107 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0109.png
   1.108 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0110.png
   1.109 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0111.png
   1.110 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0112.png
   1.111 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0113.png
   1.112 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0114.png
   1.113 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0115.png
   1.114 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0116.png
   1.115 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0117.png
   1.116 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0118.png
   1.117 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0119.png
   1.118 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0120.png
   1.119 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0121.png
   1.120 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0122.png
   1.121 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0123.png
   1.122 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0124.png
   1.123 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0125.png
   1.124 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0126.png
   1.125 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0127.png
   1.126 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0128.png
   1.127 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0129.png
   1.128 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0130.png
   1.129 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0131.png
   1.130 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0132.png
   1.131 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0133.png
   1.132 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0134.png
   1.133 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0135.png
   1.134 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0136.png
   1.135 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0137.png
   1.136 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0138.png
   1.137 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0139.png
   1.138 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0140.png
   1.139 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0141.png
   1.140 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0142.png
   1.141 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0143.png
   1.142 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0144.png
   1.143 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0145.png
   1.144 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0146.png
   1.145 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0147.png
   1.146 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0148.png
   1.147 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0149.png
   1.148 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0150.png
   1.149 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0151.png
   1.150 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0152.png
   1.151 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0153.png
   1.152 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0154.png
   1.153 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0155.png
   1.154 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0156.png
   1.155 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0157.png
   1.156 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0158.png
   1.157 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0159.png
   1.158 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0160.png
   1.159 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0161.png
   1.160 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0162.png
   1.161 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0163.png
   1.162 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0164.png
   1.163 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0165.png
   1.164 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0166.png
   1.165 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0167.png
   1.166 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0168.png
   1.167 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0169.png
   1.168 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0170.png
   1.169 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0171.png
   1.170 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0172.png
   1.171 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0173.png
   1.172 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0174.png
   1.173 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0175.png
   1.174 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0176.png
   1.175 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0177.png
   1.176 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0178.png
   1.177 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0179.png
   1.178 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0180.png
   1.179 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0181.png
   1.180 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0182.png
   1.181 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0183.png
   1.182 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0184.png
   1.183 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0185.png
   1.184 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0186.png
   1.185 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0187.png
   1.186 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0188.png
   1.187 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0189.png
   1.188 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0190.png
   1.189 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0191.png
   1.190 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0192.png
   1.191 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0193.png
   1.192 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0194.png
   1.193 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0195.png
   1.194 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0196.png
   1.195 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0197.png
   1.196 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0198.png
   1.197 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0199.png
   1.198 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0200.png
   1.199 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0201.png
   1.200 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0202.png
   1.201 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0203.png
   1.202 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0204.png
   1.203 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0205.png
   1.204 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0206.png
   1.205 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0207.png
   1.206 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0208.png
   1.207 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0209.png
   1.208 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0210.png
   1.209 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0211.png
   1.210 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0212.png
   1.211 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0213.png
   1.212 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0214.png
   1.213 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0215.png
   1.214 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0216.png
   1.215 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0217.png
   1.216 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0218.png
   1.217 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0219.png
   1.218 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0220.png
   1.219 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0221.png
   1.220 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0222.png
   1.221 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0223.png
   1.222 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0224.png
   1.223 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0225.png
   1.224 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0226.png
   1.225 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0227.png
   1.226 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0228.png
   1.227 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0229.png
   1.228 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0230.png
   1.229 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0231.png
   1.230 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0232.png
   1.231 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0233.png
   1.232 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0234.png
   1.233 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0235.png
   1.234 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0236.png
   1.235 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0237.png
   1.236 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0238.png
   1.237 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0239.png
   1.238 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0240.png
   1.239 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0241.png
   1.240 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0242.png
   1.241 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0243.png
   1.242 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0244.png
   1.243 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0245.png
   1.244 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0246.png
   1.245 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0247.png
   1.246 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0248.png
   1.247 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0249.png
   1.248 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0250.png
   1.249 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0251.png
   1.250 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0252.png
   1.251 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0253.png
   1.252 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0254.png
   1.253 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0255.png
   1.254 +/home/eleni/code/med/test1/data/la_colonoscopie/IM-0001-0256.png
     2.1 --- a/src/main.cc	Fri Jan 17 23:45:56 2014 +0200
     2.2 +++ b/src/main.cc	Sat Jan 18 01:57:52 2014 +0200
     2.3 @@ -4,7 +4,7 @@
     2.4  #include <stdio.h>
     2.5  #include <assert.h>
     2.6  
     2.7 -#include "image.h"
     2.8 +#include "volume.h"
     2.9  
    2.10  //static void init(void);
    2.11  static void display(void);
    2.12 @@ -19,8 +19,9 @@
    2.13  // debug TODO remove
    2.14  ////////////////////////////
    2.15  static bool init();
    2.16 -Image img;
    2.17 -unsigned int tex;
    2.18 +
    2.19 +static Volume *vol;
    2.20 +static float cur_z;
    2.21  
    2.22  int main(int argc, char **argv)
    2.23  {
    2.24 @@ -53,15 +54,15 @@
    2.25  void display(void)
    2.26  {
    2.27  	//render
    2.28 -	glBindTexture(GL_TEXTURE_2D, tex);
    2.29 -	glEnable(GL_TEXTURE_2D);
    2.30 +	glBindTexture(GL_TEXTURE_3D, vol->get_texture());
    2.31 +	glEnable(GL_TEXTURE_3D);
    2.32  	glBegin(GL_QUADS);
    2.33 -	glTexCoord2f(0, 0); glVertex3f(-1, -1, 0);
    2.34 -	glTexCoord2f(0, 1); glVertex3f(-1, 1, 0);
    2.35 -	glTexCoord2f(1, 1); glVertex3f(1, 1, 0);
    2.36 -	glTexCoord2f(1, 0); glVertex3f(1, -1, 0);
    2.37 +	glTexCoord3f(0, 0, cur_z); glVertex3f(-1, -1, 0);
    2.38 +	glTexCoord3f(0, 1, cur_z); glVertex3f(-1, 1, 0);
    2.39 +	glTexCoord3f(1, 1, cur_z); glVertex3f(1, 1, 0);
    2.40 +	glTexCoord3f(1, 0, cur_z); glVertex3f(1, -1, 0);
    2.41  	glEnd();
    2.42 -	glDisable(GL_TEXTURE_2D);
    2.43 +	glDisable(GL_TEXTURE_3D);
    2.44  
    2.45  	glutSwapBuffers();
    2.46  	assert(glGetError() == GL_NO_ERROR);
    2.47 @@ -100,21 +101,21 @@
    2.48  	int dy = y - prev_y;
    2.49  	prev_x = x;
    2.50  	prev_y = y;
    2.51 +
    2.52 +	if(dx != 0) {
    2.53 +		cur_z = (float)x / (float)win_xsz;
    2.54 +		glutPostRedisplay();
    2.55 +	}
    2.56  }
    2.57  
    2.58  bool init()
    2.59  {
    2.60 -	if(!img.load("data/la_colonoscopie/IM-0001-0248.png")) {
    2.61 -		fprintf(stderr, "Failed to load votre Colonoscopie\n");
    2.62 +	vol = new Volume;
    2.63 +	if(!vol->load("data/test1.vol")) {
    2.64 +		fprintf(stderr, "Failed to load test1.vol");
    2.65  		return false;
    2.66  	}
    2.67 -
    2.68 -	glGenTextures(1, &tex);
    2.69 -	glBindTexture(GL_TEXTURE_2D, tex);
    2.70 -	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    2.71 -	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    2.72 -	glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE16F_ARB, img.get_width(),
    2.73 -			img.get_height(), 0, GL_LUMINANCE, GL_FLOAT, img.get_pixels());
    2.74 +	cur_z = 0.5;
    2.75  
    2.76  	return true;
    2.77  }
     3.1 --- a/src/volume.cc	Fri Jan 17 23:45:56 2014 +0200
     3.2 +++ b/src/volume.cc	Sat Jan 18 01:57:52 2014 +0200
     3.3 @@ -1,3 +1,7 @@
     3.4 +#include <GL/glew.h>
     3.5 +
     3.6 +#include <assert.h>
     3.7 +
     3.8  #include <ctype.h>
     3.9  #include <errno.h>
    3.10  #include <stdio.h>
    3.11 @@ -14,9 +18,40 @@
    3.12  {
    3.13  	width = height = 0;
    3.14  	zaspect = 1;
    3.15 +	vol_tex_valid = false;
    3.16 +
    3.17 +	glGenTextures(1, &vol_tex);
    3.18  }
    3.19  
    3.20 -bool Volume::load_volume(const char *fname)
    3.21 +Volume::~Volume()
    3.22 +{
    3.23 +	glDeleteTextures(1, &vol_tex);
    3.24 +}
    3.25 +
    3.26 +void Volume::create_vol_tex() const
    3.27 +{
    3.28 +	if(slices.empty())
    3.29 +		return;
    3.30 +
    3.31 +	glBindTexture(GL_TEXTURE_3D, vol_tex);
    3.32 +	glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    3.33 +	glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    3.34 +	glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    3.35 +	glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    3.36 +	glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
    3.37 +
    3.38 +	assert(glGetError() == GL_NO_ERROR);
    3.39 +	glTexImage3D(GL_TEXTURE_3D, 0, GL_LUMINANCE, width, height,
    3.40 +			slices.size(), 0, GL_LUMINANCE, GL_FLOAT, 0);
    3.41 +	assert(glGetError() == GL_NO_ERROR);
    3.42 +
    3.43 +	for(size_t i=0; i<slices.size(); i++) {
    3.44 +		glTexSubImage3D(GL_TEXTURE_3D, 0, 0, 0, i, width, height,
    3.45 +				1, GL_LUMINANCE, GL_FLOAT, slices[i].get_pixels());
    3.46 +	}
    3.47 +}
    3.48 +
    3.49 +bool Volume::load(const char *fname)
    3.50  {
    3.51  	FILE *fp = fopen(fname, "r");
    3.52  	if(!fp) {
    3.53 @@ -85,6 +120,49 @@
    3.54  	return true;
    3.55  }
    3.56  
    3.57 +const Image *Volume::get_slice(int num_slice) const
    3.58 +{
    3.59 +	if(num_slice >= (int)slices.size() || num_slice < 0)
    3.60 +		return 0;
    3.61 +
    3.62 +	return &slices[num_slice];
    3.63 +}
    3.64 +
    3.65 +const Image *Volume::get_slice_by_z(float z) const
    3.66 +{
    3.67 +	int idx = get_slice_idx_by_z(z);
    3.68 +	return get_slice(idx);
    3.69 +}
    3.70 +
    3.71 +int Volume::get_slice_count() const
    3.72 +{
    3.73 +	return (int)slices.size();
    3.74 +}
    3.75 +
    3.76 +int Volume::get_slice_idx_by_z(float z) const
    3.77 +{
    3.78 +	int last_slice_idx = (int)slices.size() - 1;
    3.79 +	int idx = z * last_slice_idx;
    3.80 +	if(idx < 0) {
    3.81 +		idx = 0;
    3.82 +	}
    3.83 +	else if(idx > last_slice_idx) {
    3.84 +		idx = last_slice_idx;
    3.85 +	}
    3.86 +
    3.87 +	return idx;
    3.88 +}
    3.89 +
    3.90 +unsigned int Volume::get_texture() const
    3.91 +{
    3.92 +	if(!vol_tex_valid) {
    3.93 +		create_vol_tex();
    3.94 +		vol_tex_valid = true;
    3.95 +	}
    3.96 +
    3.97 +	return vol_tex;
    3.98 +}
    3.99 +
   3.100  void Volume::draw()
   3.101  {
   3.102  }
     4.1 --- a/src/volume.h	Fri Jan 17 23:45:56 2014 +0200
     4.2 +++ b/src/volume.h	Sat Jan 18 01:57:52 2014 +0200
     4.3 @@ -7,15 +7,30 @@
     4.4  class Volume {
     4.5  private:
     4.6  	std::vector<Image> slices;
     4.7 +
     4.8  	int width;
     4.9  	int height;
    4.10  	float zaspect;
    4.11  
    4.12 +	unsigned int vol_tex;
    4.13 +	mutable bool vol_tex_valid;
    4.14 +
    4.15 +	void create_vol_tex() const;
    4.16 +
    4.17  public:
    4.18  	Volume();
    4.19 +	~Volume();
    4.20  
    4.21 -	bool load_volume(const char *fname);
    4.22 +	bool load(const char *fname);
    4.23 +
    4.24  	bool push_slice(Image &&slice);
    4.25 +	const Image *get_slice(int num_slice) const;
    4.26 +	const Image *get_slice_by_z(float z) const;
    4.27 +	int get_slice_count() const;
    4.28 +
    4.29 +	int get_slice_idx_by_z(float z) const;
    4.30 +
    4.31 +	unsigned int get_texture() const;
    4.32  
    4.33  	void draw();
    4.34  };