From: Eduardo DAVILA Date: Sun, 12 Jan 2020 21:37:20 +0000 (+0100) Subject: #3340 creaMaracasVisu Bug New Normal - ManualPaint_model Active option X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=bbb19bdd8a8eb66baed150fc60a37976ecc4a67c;p=creaMaracasVisu.git #3340 creaMaracasVisu Bug New Normal - ManualPaint_model Active option --- diff --git a/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx b/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx index 5ff2df7..58df16c 100644 --- a/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx +++ b/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx @@ -34,82 +34,85 @@ void ManualPaint_Model::Process() // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " <SetActive( bbGetInputActive() ); - manualpaintmodel->SetTool( bbGetInputTool() ); - manualpaintmodel->Set2D3D( bbGetInput2D3D() ); - manualpaintmodel->SetImages( bbGetInputImage(),bbGetInputImage2() ); - manualpaintmodel->SetGrayLevel( bbGetInputGrayLevel() ); - manualpaintmodel->SetDirection( bbGetInputDirection() ); - manualpaintmodel->SetBrushSize( bbGetInputBrushSize() ); - manualpaintmodel->SetBrushForm( bbGetInputBrushForm() ); - manualpaintmodel->SetToleranceFill( bbGetInputToleranceFill() ); - manualpaintmodel->SetDistanceFill( bbGetInputDistanceFill() ); - manualpaintmodel->SetRangeMin( bbGetInputRange()[0] ); - manualpaintmodel->SetRangeMax( bbGetInputRange()[1] ); - if (bbGetInputPoint().size()==3) - { - manualpaintmodel->PaintImage( bbGetInputPoint()[0] , bbGetInputPoint()[1] , bbGetInputPoint()[2] ); - manualpaintmodel->SetUndoImage(); - } // if Points - if ( bbGetInputByLstPointsX().size()!=0 ) - { - int i,size = bbGetInputByLstPointsX().size(); - for (i=0;iSetActive( bbGetInputActive() ); + manualpaintmodel->SetTool( bbGetInputTool() ); + manualpaintmodel->Set2D3D( bbGetInput2D3D() ); + manualpaintmodel->SetImages( bbGetInputImage(),bbGetInputImage2() ); + manualpaintmodel->SetGrayLevel( bbGetInputGrayLevel() ); + manualpaintmodel->SetDirection( bbGetInputDirection() ); + manualpaintmodel->SetBrushSize( bbGetInputBrushSize() ); + manualpaintmodel->SetBrushForm( bbGetInputBrushForm() ); + manualpaintmodel->SetToleranceFill( bbGetInputToleranceFill() ); + manualpaintmodel->SetDistanceFill( bbGetInputDistanceFill() ); + manualpaintmodel->SetRangeMin( bbGetInputRange()[0] ); + manualpaintmodel->SetRangeMax( bbGetInputRange()[1] ); + if (bbGetInputPoint().size()==3) { - manualpaintmodel->PaintImage( bbGetInputByLstPointsX()[i] , bbGetInputByLstPointsY()[i] , bbGetInputByLstPointsZ()[i] ); -// _manualPaintModel->SetUndoImage(); // Probably needed. Here is ok. - } // for - }// if ByLstPointsX - if ((bbGetInputByImagePoints()!=NULL) && (bbGetInputImage2()!=NULL) ) - { -// int ia,ja,ka; -// int ii,jj,kk; - int ext[6]; -//EED 2017-01-01 Migration VTK7 -#if VTK_MAJOR_VERSION <= 5 - bbGetInputByImagePoints()->GetWholeExtent(ext); -#else - bbGetInputByImagePoints()->GetExtent(ext); -#endif - int dimX=ext[1]-ext[0]+1; - int dimY=ext[3]-ext[2]+1; - int dimZ=ext[5]-ext[4]+1; - DEF_POINTER_IMAGE_VTK_CREA(vBIP,sSBIP,pBIP,sTBIP,bbGetInputByImagePoints()); - DEF_POINTER_IMAGE_VTK_CREA(vI2,sSI2,pI2,sTI2,bbGetInputImage2()); -//#pragma omp parallel for - int i,j,k; - for (k=0;kPaintImage( bbGetInputPoint()[0] , bbGetInputPoint()[1] , bbGetInputPoint()[2] ); + manualpaintmodel->SetUndoImage(); + } // if Points + if ( bbGetInputByLstPointsX().size()!=0 ) { - if (k%50==0) + int i,size = bbGetInputByLstPointsX().size(); + for (i=0;iPaintImage( bbGetInputByLstPointsX()[i] , bbGetInputByLstPointsY()[i] , bbGetInputByLstPointsZ()[i] ); + // _manualPaintModel->SetUndoImage(); // Probably needed. Here is ok. + } // for + }// if ByLstPointsX + if ((bbGetInputByImagePoints()!=NULL) && (bbGetInputImage2()!=NULL) ) + { + // int ia,ja,ka; + // int ii,jj,kk; + int ext[6]; + //EED 2017-01-01 Migration VTK7 + #if VTK_MAJOR_VERSION <= 5 + bbGetInputByImagePoints()->GetWholeExtent(ext); + #else + bbGetInputByImagePoints()->GetExtent(ext); + #endif + int dimX=ext[1]-ext[0]+1; + int dimY=ext[3]-ext[2]+1; + int dimZ=ext[5]-ext[4]+1; + DEF_POINTER_IMAGE_VTK_CREA(vBIP,sSBIP,pBIP,sTBIP,bbGetInputByImagePoints()); + DEF_POINTER_IMAGE_VTK_CREA(vI2,sSI2,pI2,sTI2,bbGetInputImage2()); + //#pragma omp parallel for + int i,j,k; + for (k=0;k0) + for (i=0;i0) { - manualpaintmodel->PaintImage(i,j,k); -// manualpaintmodel->SetUndoImage(); // Probably needed. Here is ok. - } // vI2 - } // vBIP - pBIP = pBIP + sSBIP; - pI2 = pI2 + sSI2; - }// for i - }// for j - }// for k - printf("ManualPaint_Model %d%\n", 100 ); - } // if ByImagePoints - } else { - printf("EED Warning: ByImagePoints or Image2 not set. Box creaMaracasVisu::ManualPaint_Model (BBTK) \n"); - } // if ((bbGetInputByImagePoints()!=NULL) && (bbGetInputImage2()!=NULL) ) + GETVALUE_VTK_CREA(vI2,pI2,sTI2) + if (vI2==0) + { + manualpaintmodel->PaintImage(i,j,k); + // manualpaintmodel->SetUndoImage(); // Probably needed. Here is ok. + } // vI2 + } // vBIP + pBIP = pBIP + sSBIP; + pI2 = pI2 + sSI2; + }// for i + }// for j + }// for k + printf("ManualPaint_Model %d%\n", 100 ); + } // if ByImagePoints + } else { + printf("EED Warning: ByImagePoints or Image2 not set. Box creaMaracasVisu::ManualPaint_Model (BBTK) \n"); + } // if ((bbGetInputByImagePoints()!=NULL) && (bbGetInputImage2()!=NULL) ) + } // if active if (bbGetInputImage2()!=NULL) { @@ -162,10 +165,7 @@ void ManualPaint_Model::bbUserInitializeProcessing() // Here does nothing // but this is where you should allocate the internal/output pointers // if any - - manualpaintmodel=new ManualPaintModel(); - - + manualpaintmodel=new ManualPaintModel(); } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)