Stefan van der Heijden (Stefan.vdHeijden@best.ms.philips.com)
Tue, 20 Jul 1999 12:32:36 +0200
void Determine_Histogram()
{
int sum=0;
for (int i =0 ;i<256;i++)Hist[i]=0;;
MaxHistval=0;
voBrickSetIterator brickSetIter(aVolume->getCurrentBrickSet());
for (voBrick * brick; brick = brickSetIter();) {
int xBrickOrigin, yBrickOrigin, zBrickOrigin;
int xBrickSize, yBrickSize, zBrickSize;
void *vdata = brick->getDataPtr();
unsigned char *start;
// get brick sizes -- they may different than those requested
brick->getBrickSizes(xBrickOrigin, yBrickOrigin, zBrickOrigin,
xBrickSize, yBrickSize, zBrickSize);
start =(unsigned char *)vdata;
for ( i =0 ;i<xBrickSize*yBrickSize*zBrickSize;i++)
Hist[(int)*(start+i)]++;
for ( i =0 ;i<256;i++)
{
sum+=Hist[i];
if (Hist[i]>MaxHistval){MaxHistval=Hist[i];}
}
}
printf( "Number of Voxels %d\n",sum);
}
-- J.W.M v/d Heijden -oOo-@-@-oOo- XRD Predevelopment Philips Medical Systems Building QJ2327, Veenpluis 2, Best, The Netherlands Phone: +31-40-2762275 Fax : +31-40-2765657 mailto:Stefan.vdHeijden@best.ms.philips.com http://members.xoom.com/AxeCrazy Just a memory remains....
This archive was generated by hypermail 2.0b2 on Mon Nov 01 1999 - 14:11:13 PST