)
{
int i;
- int np = manualcontourmodel->GetSizeLstPoints( ); // number of control points
+ //int np = manualcontourmodel->GetSizeLstPoints( ); // number of control points // JPRx
// JSTG 26-02-08 ---------------------------------------------------------------------------------------
//int nps = manualviewbaseecontour->GetNumberOfPointsSpline(); // number of points in the spline
//------------------------------------------------------------------------
int ContourExtractData::AnalisisContourInside(int x,
- int y,
- manualContourModel *manualcontourmodel
- )
+ int y,
+ manualContourModel *manualcontourmodel
+ )
{
int result = 0;
int i;
- int np = manualcontourmodel->GetSizeLstPoints( ); // number of control points
+ //int np = manualcontourmodel->GetSizeLstPoints( ); // number of control points // JPRx
// JSTG 26-02-08 ---------------------------------------------------------------------------------------
//int nps = manualviewbaseecontour->GetNumberOfPointsSpline(); // number of points in the spline
void *p;
p = imagedata->GetScalarPointer(x,y,z);
- if (imagedata->GetScalarType()==VTK_UNSIGNED_CHAR)
- { unsigned char *pp = (unsigned char*)p;
+ if (imagedata->GetScalarType()==VTK_CHAR)
+ {
+ char *pp = (char*)p;
result = (double)(*pp);
}
- if (imagedata->GetScalarType()==VTK_FLOAT)
- { float *pp = (float*)p;
+ else if (imagedata->GetScalarType()==VTK_SIGNED_CHAR)
+ {
+ signed char *pp = (signed char*)p;
result = (double)(*pp);
}
- if (imagedata->GetScalarType()==VTK_SHORT)
- { short *pp = (short*)p;
+ else if (imagedata->GetScalarType()==VTK_UNSIGNED_CHAR)
+ {
+ unsigned char *pp = (unsigned char*)p;
result = (double)(*pp);
}
- if (imagedata->GetScalarType()==VTK_UNSIGNED_SHORT)
- { unsigned short *pp = (unsigned short*)p;
+ else if (imagedata->GetScalarType()==VTK_SHORT)
+ {
+ short *pp = (short*)p;
+ result = (double)(*pp);
+ }
+ else if (imagedata->GetScalarType()==VTK_UNSIGNED_SHORT)
+ {
+ unsigned short *pp = (unsigned short*)p;
+ result = (double)(*pp);
+ }
+ else if (imagedata->GetScalarType()==VTK_INT)
+ {
+ int *pp = (int*)p;
+ result = (double)(*pp);
+ }
+ else if (imagedata->GetScalarType()==VTK_UNSIGNED_INT)
+ {
+ unsigned int *pp = (unsigned int*)p;
result = (double)(*pp);
}
+ else if (imagedata->GetScalarType()==VTK_LONG)
+ {
+ long *pp = (long*)p;
+ result = (double)(*pp);
+ }
+ else if (imagedata->GetScalarType()==VTK_UNSIGNED_LONG)
+ {
+ unsigned long *pp = (unsigned long*)p;
+ result = (double)(*pp);
+ }
+ else if (imagedata->GetScalarType()==VTK_FLOAT)
+ {
+ float *pp = (float*)p;
+ result = (double)(*pp);
+ }
+ else if (imagedata->GetScalarType()==VTK_DOUBLE)
+ {
+ double *pp = (double*)p;
+ result = (double)(*pp);
+ }
+
return result;
}