]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx
BUG view MPR
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / Contour / ContourExtractData.cxx
index e64fa03a444370e831d5e8e3162e631fd35192d8..8f98a10d2de04ce53a557b174bcff35d3d15333f 100644 (file)
@@ -197,22 +197,62 @@ double ContourExtractData::GetDataValue(int x, int y, int z)
        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;
 }