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=acb9e7872538f517a1185bc503e7c64e48d54d6e;hpb=c5feadbb145eecf6d73f793535b7e23eb18db2cb;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx index acb9e78..8f98a10 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx @@ -47,7 +47,7 @@ void ContourExtractData::GetMinMaxPoint(int *minPoint, ) { 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 @@ -87,13 +87,13 @@ void ContourExtractData::GetMinMaxPoint_Of_LstManConMod( int *minPoint, //------------------------------------------------------------------------ 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 @@ -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; }