From d5af755ce7c206a54eba944a941a2bcc21718ff8 Mon Sep 17 00:00:00 2001 From: Pablo Garzon Date: Tue, 18 Jul 2023 13:31:13 +0200 Subject: [PATCH] #3501 Geodesic Deformation --- .../itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx | 13 ++++++++++--- .../itkvtk/src/bbitkvtkGeodesicMeshDeformation.h | 3 ++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx b/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx index 1ecc52f..9bcf5fe 100644 --- a/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx +++ b/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx @@ -30,6 +30,8 @@ void GeodesicMeshDeformation::Process() bool ok = false; bool pdChanged = false; using MeshType = itk::QuadEdgeMesh; + std::vector deformInfo; + bbSetOutputOut(deformInfo); //Set up QuadEdge and filter every time polydata changes if ((bbGetInputIn() != polydata) && (bbGetInputActive()==true) && (bbGetInputIn() != NULL)) @@ -140,7 +142,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 { @@ -213,9 +215,12 @@ void GeodesicMeshDeformation::Process() points->SetPoint(BegProcessedIt.Value().GetNode(), np); } ++BegProcessedIt; - } + } + std::vector info{pb[0],pb[1],pb[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 +244,8 @@ void GeodesicMeshDeformation::bbUserSetDefaultValues() EdgeIdBack=-1; bbSetInputEdgeId(EdgeIdBack); bbSetInputS(10); + std::vector OutputVect; + bbSetOutputOut(OutputVect); backLstCenter.push_back(0); backLstCenter.push_back(0); diff --git a/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.h b/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.h index 83c6beb..e5a325d 100644 --- a/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.h +++ b/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.h @@ -32,7 +32,7 @@ class bbitkvtk_EXPORT GeodesicMeshDeformation BBTK_DECLARE_INPUT(S, double); BBTK_DECLARE_INPUT(Center, std::vector); BBTK_DECLARE_INPUT(Direction, std::vector); - //BBTK_DECLARE_OUTPUT(Out,double); + BBTK_DECLARE_OUTPUT(Out, std::vector); BBTK_PROCESS(Process); void Process(); @@ -66,6 +66,7 @@ BBTK_INPUT(GeodesicMeshDeformation,EdgeId,"Edge Id",long,""); BBTK_INPUT(GeodesicMeshDeformation,S,"Deformation",double,""); BBTK_INPUT(GeodesicMeshDeformation,Center,"[X,Y,Z]",std::vector,""); BBTK_INPUT(GeodesicMeshDeformation,Direction,"(default [1,0,0]) [X,Y,Z]",std::vector,""); +BBTK_OUTPUT(GeodesicMeshDeformation,Out,"double vector output, for output information for other tools",std::vector,""); BBTK_END_DESCRIBE_BLACK_BOX(GeodesicMeshDeformation); //===== // 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) -- 2.47.1