: manualContourModel()
{
SetNumberOfPointsSpline(2);
+ SetNumberOfPointsSpline(2);
}
manualContourModelLine::~manualContourModelLine()
unsigned int i, nps,nps_t;
nps = _sizePointsContour;
+
if (this->_manContModel->IfCloseContour()==true)
{
nps_t = nps;
}
//ED
- printf("\n>%d ",nps_t);
+ //printf("\n Number of points %d ",nps_t);
for( i = 0; i < nps_t; i++ )
{
d3= sqrt( (ppB[0]-ppA[0])*(ppB[0]-ppA[0]) + (ppB[1]-ppA[1])*(ppB[1]-ppA[1]) + (ppB[2]-ppA[2])*(ppB[2]-ppA[2]));
//ED
- printf("%d %f %f %f - ", i,d1,d2,d3);
+ //printf("\n Dist1 %f Dist2 %f Dist3 %f PT %d", d1,d2,d3,i);
if ( ((d1+d2)>=d3) && ((d1+d2)<=d3*1.3) )
{
// ----------------------------------------------------------------------------
+
bool manualViewRoi::ifTouchContour(int x,int y, int z) // virtual
{
bool result=false;
- double px1=99999,py1=99999,px2=-9999,py2=-99999;
+ double px1=99999,py1=99999,px2=-99999,py2=-99999;
GetMinMax(px1,py1, px2, py2);
return result;
}
-
// ----------------------------------------------------------------------------
void manualViewRoi::InitMove(int x, int y, int z) // virtual
char zTzxt[20];
char resultText[50];
strcpy(resultText,"GL: ");
- if (ok==true) {
- unsigned short *pOrg=(unsigned short*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
-// itoa (*pOrg,zTzxt,10);
- int tmp=*pOrg;
- sprintf(zTzxt,"%d",tmp);
+ if (ok==true)
+ {
+ if (imagedata->GetScalarType()==VTK_BIT)
+ {
+ char *pOrg=(char*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ if(*pOrg==0)
+ {
+ sprintf(zTzxt,"%d",0);
+ }
+ else
+ {
+ sprintf(zTzxt,"%d",1);
+ }
+ }
+
+ if (imagedata->GetScalarType()==VTK_CHAR)
+ {
+ char *pOrg=(char*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ int tmp=*pOrg;
+ sprintf(zTzxt,"%d",tmp);
+ }
- } else {
+ if (imagedata->GetScalarType()==VTK_SIGNED_CHAR)
+ {
+ signed char *pOrg=(signed char*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ int tmp=*pOrg;
+ sprintf(zTzxt,"%d",tmp);
+ }
+
+ if (imagedata->GetScalarType()==VTK_UNSIGNED_CHAR)
+ {
+ unsigned char *pOrg=(unsigned char*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ int tmp=*pOrg;
+ sprintf(zTzxt,"%d",tmp);
+ }
+
+ if (imagedata->GetScalarType()==VTK_SHORT)
+ {
+ short *pOrg=(short*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ int tmp=*pOrg;
+ sprintf(zTzxt,"%d",tmp);
+ }
+
+ if (imagedata->GetScalarType()==VTK_UNSIGNED_SHORT)
+ {
+ unsigned short *pOrg=(unsigned short*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ int tmp=*pOrg;
+ sprintf(zTzxt,"%d",tmp);
+ }
+
+ if (imagedata->GetScalarType()==VTK_INT)
+ {
+ int *pOrg=(int*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ sprintf(zTzxt,"%d",*pOrg);
+ }
+
+ if (imagedata->GetScalarType()==VTK_UNSIGNED_INT)
+ {
+ unsigned int *pOrg=(unsigned int*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ int tmp=*pOrg;
+ sprintf(zTzxt,"%d",tmp);
+ }
+
+ if (imagedata->GetScalarType()==VTK_LONG)
+ {
+ long *pOrg=(long*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ double tmp=*pOrg;
+ sprintf(zTzxt,"%3.2f",tmp);
+ }
+
+ if (imagedata->GetScalarType()==VTK_UNSIGNED_LONG)
+ {
+ unsigned long *pOrg=(unsigned long*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ double tmp=*pOrg;
+ sprintf(zTzxt,"%3.2f",tmp);
+ }
+
+ if (imagedata->GetScalarType()==VTK_FLOAT)
+ {
+ long *pOrg=(long*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ double tmp=*pOrg;
+ sprintf(zTzxt,"%3.2f",tmp);
+ }
+
+ if (imagedata->GetScalarType()==VTK_DOUBLE)
+ {
+ double *pOrg=(double*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ double tmp=*pOrg;
+ sprintf(zTzxt,"%3.2f",tmp);
+ }
+ }
+ else
+ {
strcpy(zTzxt,"---");
}
strcat(resultText,zTzxt);