From: Eduardo DAVILA Date: Wed, 12 May 2021 16:26:45 +0000 (+0200) Subject: Redistribution SIN X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=018e0f81801f203ec4feff683d18ee6ee06d64c3;p=creaMaracasVisu.git Redistribution SIN --- diff --git a/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.cxx b/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.cxx index 11806ac..9623d4c 100644 --- a/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.cxx +++ b/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.cxx @@ -442,7 +442,6 @@ void ManualContourModel_Box::RedistributionPointsAllContours_SIN( std::vector *lstOutZ, std::vector *lstIndexsOut ) { -printf("ManualContourModel_Box::RedistributionPointsAllContours_SIN start\n"); std::vector lstTmp1X; std::vector lstTmp1Y; std::vector lstTmp1Z; @@ -472,7 +471,6 @@ printf("ManualContourModel_Box::RedistributionPointsAllContours_SIN start\n"); double distAcum; double minDistAcum; - // ------------ Wave 1 ----------------- ExtractContour(lstOutX,lstOutY,lstOutZ,lstIndexsOut,0,&lstTmp1X,&lstTmp1Y,&lstTmp1Z); @@ -481,7 +479,6 @@ printf("ManualContourModel_Box::RedistributionPointsAllContours_SIN start\n"); // Increment for ( iContour=0; iContour=0 ; iContour-- ) { -printf("ManualContourModel_Box::RedistributionPointsAllContours_SIN iContour=%d\n",iContour); beta = 0; alpha = 0; // find Alpha @@ -607,9 +597,6 @@ printf("ManualContourModel_Box::RedistributionPointsAllContours_SIN iContour=%d\ Redistribution_SIN( alpha,beta, &lstTmp2X,&lstTmp2Y,&lstTmp2Z ,sizeContour2, &lstTmp2aX,&lstTmp2aY,&lstTmp2aZ ); -// if(lstTmp2Y[0]==385) { alpha=bbGetInputParam()[1]; beta=bbGetInputParam()[2]; printf("ManualContourModel_Box::RedistributionPointsAllContours_SIN ---385-- \n"); } -printf("ManualContourModel_Box::RedistributionPointsAllContours_SIN wave 2 alpha=%f beta=%f z=%f sc1=%f sc2=%f\n",alpha,beta,lstTmp2Y[0], sizeContour1,sizeContour2 ); - PutPointsInContour(&lstTmp2aX,&lstTmp2aY,&lstTmp2aZ, iContour-1 ,lstOutX,lstOutY,lstOutZ,lstIndexsOut); sizeContour1 = sizeContour2; CopyContour2InContour1( &lstTmp2aX,&lstTmp2aY,&lstTmp2aZ , &lstTmp1X,&lstTmp1Y,&lstTmp1Z ); @@ -620,11 +607,11 @@ printf("ManualContourModel_Box::RedistributionPointsAllContours_SIN wave 2 alpha // ------------ Wave 3 ----------------- - printf("ManualContourModel_Box::RedistributionPointsAllContours_SIN wave3 los que faltan"); + double alpha1,alpha2; + double beta1,beta2; double iExtra,sizeExtra=lstContourExeption.size(); for ( iExtra=0 ; iExtrabeta1) + { + alpha = alpha2; + } else { + alpha = alpha1; + } + beta = ( beta1 + beta2 ) / 2; Redistribution_SIN( alpha,beta, &lstTmp2X,&lstTmp2Y,&lstTmp2Z ,sizeContour2, &lstTmp2bX,&lstTmp2bY,&lstTmp2bZ ); - + PutPointsInContour(&lstTmp2bX,&lstTmp2bY,&lstTmp2bZ, lstContourExeption[iExtra] ,lstOutX,lstOutY,lstOutZ,lstIndexsOut); + +// Redistribution_SIN( alpha1,beta1, &lstTmp2X,&lstTmp2Y,&lstTmp2Z ,sizeContour2, &lstTmp2aX,&lstTmp2aY,&lstTmp2aZ ); +// Redistribution_SIN( alpha2,beta2, &lstTmp2X,&lstTmp2Y,&lstTmp2Z ,sizeContour2, &lstTmp2bX,&lstTmp2bY,&lstTmp2bZ ); // Mixing2DistributionVectors(&lstTmp2aX,&lstTmp2aY,&lstTmp2aZ,&lstTmp2bX,&lstTmp2bY,&lstTmp2bZ, &lstTmp2cX,&lstTmp2cY,&lstTmp2cZ ); - PutPointsInContour(&lstTmp2cX,&lstTmp2cY,&lstTmp2cZ, lstContourExeption[iExtra] ,lstOutX,lstOutY,lstOutZ,lstIndexsOut); - +// PutPointsInContour(&lstTmp2cX,&lstTmp2cY,&lstTmp2cZ, lstContourExeption[iExtra] ,lstOutX,lstOutY,lstOutZ,lstIndexsOut); + + } // for iExtra +} + + + +void ManualContourModel_Box::Mixing2DistributionVectors( std::vector *lstAX, + std::vector *lstAY, + std::vector *lstAZ, + std::vector *lstBX, + std::vector *lstBY, + std::vector *lstBZ, + std::vector *lstOutX, + std::vector *lstOutY, + std::vector *lstOutZ) +{ + (*lstOutX).clear(); + (*lstOutY).clear(); + (*lstOutZ).clear(); + std::vector lstTmpX; + std::vector lstTmpY; + std::vector lstTmpZ; + double dx,dy,dz; + double distA,distAT; + double distB,distBT; + int i,j,size; + int ii,sizeTmpX; + bool flagA,flagB; + + distAT = 0; + distBT = 0; + i = 1; + j = 1; + size = (*lstAX).size(); + lstTmpX.push_back( (*lstAX)[0] ); + lstTmpY.push_back( (*lstAY)[0] ); + lstTmpZ.push_back( (*lstAZ)[0] ); + lstTmpX.push_back( (*lstBX)[0] ); + lstTmpY.push_back( (*lstBY)[0] ); + lstTmpZ.push_back( (*lstBZ)[0] ); + while ((i(distBT+distB)) + { + flagB=true; + } else { + flagA=true; + flagB=true; + } // if distAT+distA distBT+distB + + if (flagA==true) + { + lstTmpX.push_back( (*lstAX)[i] ); + lstTmpY.push_back( (*lstAY)[i] ); + lstTmpZ.push_back( (*lstAZ)[i] ); + distAT = distAT+distA; + i++; + } // if flagA + + if (flagB==true) + { + lstTmpX.push_back( (*lstBX)[j] ); + lstTmpY.push_back( (*lstBY)[j] ); + lstTmpZ.push_back( (*lstBZ)[j] ); + distBT = distBT+distB; + j++; + } // if flagA + + } // while i j + sizeTmpX = lstTmpX.size(); + for (ii=0; ii *lstInX, std::vector *lstOutY, std::vector *lstOutZ ); +void Mixing2DistributionVectors( std::vector *lstAX, + std::vector *lstAY, + std::vector *lstAZ, + std::vector *lstBX, + std::vector *lstBY, + std::vector *lstBZ, + std::vector *lstOutX, + std::vector *lstOutY, + std::vector *lstOutZ); +