X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2FContour%2FContourExtractData.cxx;h=8f98a10d2de04ce53a557b174bcff35d3d15333f;hb=885faee171b5cdcbcbbcb6cc83e6d196544e005c;hp=e64fa03a444370e831d5e8e3162e631fd35192d8;hpb=8e7ab74a199d1f05b01dccfb75da7f2c4754ddc5;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx index e64fa03..8f98a10 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx @@ -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; }