⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainkiefertest.html

📁 Delaunay三角形的网格剖分程序
💻 HTML
字号:
<TITLE>COG 2.1: CT data</TITLE><h1>CT Data</h1> <P>Of course, this particular human being does not look very happy.But at least it can be seen that it is a human face - a quite niceresult for one day of implementation of their CT data into COG at theTU Munich:<P><IMG SRC="kiefertest.gif"><PRE>#include "cog/coglib.hxx"#include "cog/cogenvoxmap.hxx"#include <stdio.h>int main(){</PRE><h2> Grayscale table </h2> <p>Data from header file<listing>1.5058 64-1 -12.000000 2.000000 1.00000013.000000 1.000000 0.0000001094 3654 1127288 576 4401295 1411 13511339 2065 1455(threshold values: skin - fat - tissue - bones)</listing> <P>The range we have used for the actual picture was a false one,from another picture, as we have observed too late:<PRE>  wzGrayScaleTable table;  table.addRange(2,930, 1894);  //  table.addRange(2,1339, 2065);    table.addRange(1,0,0xffff);   FILE *fp = fopen("kiefer.dat", "rb");  wzIndex xlen = 58;  wzIndex ylen = 64;  wzIndex zlen = 74;  // = sizeof(file.dat)/(2*xlen*ylen)=549376/(58*64*2)  cogenVoxmap   map = new CogenVoxmap(xlen,ylen,zlen);  map->setXRange(0.0,1.0);  map->setYRange(0.0,1.0);  map->setZRange(0.0,1.0);</PRE><h2> Filling the pixmap with values </h2> <P>Then you have to fill the pixel array with the regions.  We assume that you read the <i>grayvalue</i> for a given pixel defined by <i>ix,iy,iz</i> from a file, but here we use the sum<i>ix+iy+iz</i> as a simple example:<PRE>  wzGrayValue g;  int ix,iy,iz;  for(iz=0;iz<map->lz();iz++){    for(iy=0;iy<map->ly();iy++){      for(ix=0;ix<map->lx();ix++){	fread(&g, sizeof g, 1, fp);	g = (g>>8)|((g&0xff)<<8);        wzGrayValue grayvalue = g;  // or something else from file	map->pixmap()(ix,iy,iz) = table(grayvalue);	// printf("%d, -> %d \n",grayvalue,table(grayvalue));      }    }  }  fclose(fp);</PRE><p>setBorder defines the part of the full geometry which is used forgrid generation.<PRE>    //map->setBorder(0.2,0.8, 0.1,0.7, 0.3,0.9);    map->setBorder(0.0,1.0, 0.0,1.0, 0.0,1.0);  map->refinementGlobal(0.1,0.2,0.2);   map->faceRefinementGlobal(0.05,0.2);  wzgrid grid = (*map->generator())();  grid->write("test.sg");  }</PRE>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -