X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fitkvtk%2Fsrc%2FbbitkvtkGeodesicMeshDeformation.cxx;h=98559509fcff7fbd279be8b342c6a87be2b9c03e;hb=296a644550aec58bcab0a7c55e486da19eef78f1;hp=9fb4792a1d993cc6df600f32cadd8b49581cd39f;hpb=9e3028e289fdda59ecf84e31be633483a27f9232;p=bbtk.git diff --git a/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx b/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx index 9fb4792..9855950 100644 --- a/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx +++ b/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx @@ -26,10 +26,13 @@ void GeodesicMeshDeformation::Process() // * TYPE is the C++ type of the input/output // (the one provided in the attribute 'type' of the tag 'input') std::vector lstCenter = bbGetInputCenter(); - double s = bbGetInputS(); - bool ok = false; - bool pdChanged = false; - using MeshType = itk::QuadEdgeMesh; + double s = bbGetInputS(); + bool ok = false; + bool pdChanged = false; + using MeshType = itk::QuadEdgeMesh; + std::vector deformInfo; + bbSetOutputOut(deformInfo); + //std::vector displacementVector; //Set up QuadEdge and filter every time polydata changes if ((bbGetInputIn() != polydata) && (bbGetInputActive()==true) && (bbGetInputIn() != NULL)) @@ -124,10 +127,10 @@ void GeodesicMeshDeformation::Process() double p[3]; // point double pb[3]; // point base double np[3]; // new point - double sx,sy,sz; - sx = s*2; - sy = sx; - sz = sy; +// double sx,sy,sz; +// sx = s*2; +// sy = s*2; +// sz = s*2; double displcement_x = 0; double displcement_y = 0; @@ -140,7 +143,7 @@ void GeodesicMeshDeformation::Process() displcement_z = bbGetInputDirection()[2]; } // if TypeIn 0 Direction - printf(" EED GeodesicMeshDeformation::Process %ld %ld - %f %f %f \n", EdgeIdBack, bbGetInputEdgeId() , lstCenter[0],lstCenter[1],lstCenter[2] ); + //printf(" EED GeodesicMeshDeformation::Process %ld %ld - %f %f %f \n", EdgeIdBack, bbGetInputEdgeId() , lstCenter[0],lstCenter[1],lstCenter[2] ); if (bbGetInputTypeIn()==1) // Center { @@ -184,7 +187,7 @@ void GeodesicMeshDeformation::Process() using CriterionType = itk::FastMarchingThresholdStoppingCriterion; auto criterion = CriterionType::New(); sCurrent = s; - criterion->SetThreshold(s*2); + criterion->SetThreshold(s*4); fmmFilter->SetStoppingCriterion(criterion); } fmmFilter->Update(); @@ -214,8 +217,13 @@ void GeodesicMeshDeformation::Process() } ++BegProcessedIt; } + //double directionMoved[3] = {lstCenter[0]-displcement_x, lstCenter[1]-displcement_y, lstCenter[2]-displcement_z}; + //vtkMath::Normalize(directionMoved); + std::vector info{lstCenter[0],lstCenter[1],lstCenter[2], bbGetInputDirection()[0] , bbGetInputDirection()[1], bbGetInputDirection()[2],(double) bbGetInputEdgeId(), s}; + bbSetOutputOut(info); + cout << "info updated" << endl; points->Modified(); - bbGetInputIn()->Modified(); + bbGetInputIn()->Modified(); }// if ffmFilter != NULL } // if distance_x y z != 0 } // In != NULL ok active @@ -239,6 +247,8 @@ void GeodesicMeshDeformation::bbUserSetDefaultValues() EdgeIdBack=-1; bbSetInputEdgeId(EdgeIdBack); bbSetInputS(10); + std::vector OutputVect; + bbSetOutputOut(OutputVect); backLstCenter.push_back(0); backLstCenter.push_back(0);