From: trillos Date: Thu, 24 Sep 2009 13:38:07 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: CREATOOLS.2-0-3~63 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=683ff9386e374db4f94ae5d4c32859cc808c3ad4;p=creaRigidRegistration.git *** empty log message *** --- diff --git a/PackRecalage/bbs/appli/ViewerMerge2DInteractive.bbs b/PackRecalage/bbs/appli/ViewerMerge2DInteractive.bbs index 4134150..74a6da9 100644 --- a/PackRecalage/bbs/appli/ViewerMerge2DInteractive.bbs +++ b/PackRecalage/bbs/appli/ViewerMerge2DInteractive.bbs @@ -93,15 +93,16 @@ new SliceImage slice1 connect reslice1.Out slice1.In set slice1.Z "1" +new Viewer2D viewer2d + connect reslice1.Out viewer2d.In + set viewer2d.Slice "1" -#new ViewerNV viewer3 - #connect reslice1.Out viewer3.In - #set viewer3.nTypeView "6" - #set viewer3.WinWidth "600" - -new Viewer2D viewer3 +new ViewerNV viewer3 connect reslice1.Out viewer3.In - set viewer3.Slice "1" + set viewer3.nTypeView "6" + set viewer3.WinWidth "600" + + #Multiple inputs for managing the interaction @@ -112,6 +113,7 @@ new MultipleInputs mult connect viewer1.BoxChange mult.In4 connect viewer2.BoxChange mult.In5 connect mult.BoxChange viewer3.BoxExecute + connect mult.BoxChange viewer2d.BoxExecute #new CommandButton botonfinal #set botonfinal.Label "Set Information" @@ -129,7 +131,7 @@ new LayoutSplit window1 new LayoutSplit main set main.WinWidth "1200" - set main.Proportion "100" + set main.Proportion "50" set main.Orientation H connect window1.Widget main.Widget1 connect viewer3.Widget main.Widget2 diff --git a/PackRecalage/src/bbPackRecalageCalculateVectorBox.cxx b/PackRecalage/src/bbPackRecalageCalculateVectorBox.cxx index 288710e..997403c 100644 --- a/PackRecalage/src/bbPackRecalageCalculateVectorBox.cxx +++ b/PackRecalage/src/bbPackRecalageCalculateVectorBox.cxx @@ -1,5 +1,8 @@ #include "bbPackRecalageCalculateVectorBox.h" #include "bbPackRecalagePackage.h" + +#include + namespace bbPackRecalage { @@ -7,29 +10,23 @@ BBTK_ADD_BLACK_BOX_TO_PACKAGE(PackRecalage,CalculateVectorBox) BBTK_BLACK_BOX_IMPLEMENTATION(CalculateVectorBox,bbtk::AtomicBlackBox); void CalculateVectorBox::Process() { - -// THE MAIN PROCESSING METHOD BODY -// Here we simply set the input 'In' value to the output 'Out' -// And print out the output value -// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : -// void bbSet{Input|Output}NAME(const TYPE&) -// const TYPE& bbGet{Input|Output}NAME() const -// Where : -// * NAME is the name of the input/output -// (the one provided in the attribute 'name' of the tag 'input') -// * TYPE is the C++ type of the input/output -// (the one provided in the attribute 'type' of the tag 'input') - //bbSetOutputOut( bbGetInputIn() ); - //std::cout << "Output value = " < newX1; + newX1.push_back((float)bbGetInputPointsX1()[0]); + std::vector newX2; + newX2.push_back((float)bbGetInputPointsX2()[0]); + } } void CalculateVectorBox::bbUserSetDefaultValues() { // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 - //bbSetInputIn(0); - + /* + std::vector nuevo("",""); + bbSetInputLabels1(nuevo);*/ } void CalculateVectorBox::bbUserInitializeProcessing() { diff --git a/PackRecalage/src/bbPackRecalageReSlicerBox.cxx b/PackRecalage/src/bbPackRecalageReSlicerBox.cxx index 71cb3fa..9aa9424 100644 --- a/PackRecalage/src/bbPackRecalageReSlicerBox.cxx +++ b/PackRecalage/src/bbPackRecalageReSlicerBox.cxx @@ -65,8 +65,10 @@ void ReSlicerBox::bbUserFinalizeProcessing() // THE FINALIZATION METHOD BODY : // Here does nothing // but this is where you should desallocate the internal/output pointers -// if any - +// if any + image->Delete(); + slicer->Delete(); + imageResult->Delete(); } } // EO namespace bbPackRecalage \ No newline at end of file diff --git a/lib/sourceTransformer.cxx b/lib/sourceTransformer.cxx index 8bcdcd2..3c234bc 100644 --- a/lib/sourceTransformer.cxx +++ b/lib/sourceTransformer.cxx @@ -93,6 +93,7 @@ vtkTransform *Transformer::GetResult() */ void Transformer::Run() { + _transform->Identity(); _transform->Translate(_centerPoint[0], _centerPoint[1], _centerPoint[2]); _transform->Scale(_scaleX, _scaleY,_scaleZ); _transform->RotateWXYZ(_angle, 0, 0, 1); diff --git a/lib/sourceVectorMath.cxx b/lib/sourceVectorMath.cxx index 37eb419..4717758 100644 --- a/lib/sourceVectorMath.cxx +++ b/lib/sourceVectorMath.cxx @@ -2,5 +2,47 @@ VectorMath::VectorMath() { + //_math = vtkMath::new(); +} -} \ No newline at end of file +VectorMath::~VectorMath() +{ + if (_math != NULL ) { _math->Delete(); } +} + +void VectorMath::SetData(std::vector pointsX1, std::vector pointsX2, std::vector pointsY1, std::vector pointsY2, std::vector pointsZ1, std::vector pointsZ2) +{ + _pointx1a = pointsX1[0]; + _pointx1b = pointsX1[1]; + + _pointx2a = pointsX2[0]; + _pointx2b = pointsX2[1]; + + _pointy1a = pointsY1[0]; + _pointy1b = pointsY1[1]; + + _pointy2a = pointsY2[0]; + _pointy2b = pointsY2[1]; + + _pointz1a = pointsZ1[0]; + _pointz1b = pointsZ1[1]; + + _pointz2a = pointsZ2[0]; + _pointz2b = pointsZ2[1]; +} +/* + +int[3]* VectorMath::GetPoints() +{ + +} + +double[3]* VectorMath::GetScales() +{ + +} + +double VectorMath::GetAngle() +{ + +}*/ \ No newline at end of file diff --git a/lib/sourceVectorMath.h b/lib/sourceVectorMath.h index 96f8f06..b13aea2 100644 --- a/lib/sourceVectorMath.h +++ b/lib/sourceVectorMath.h @@ -8,22 +8,31 @@ class VectorMath{ public: VectorMath(); ~VectorMath(); - /*void SetTransform(vtkTransform *transform); - void SetCenterPoint(std::vector point); - void SetAngle(double angle); - void SetScaleX(double scaleX); - void SetScaleY(double scaleY); - void SetScaleZ(double scaleZ); + void SetData(std::vector pointsX1, std::vector pointsX2, std::vector pointsY1, std::vector pointsY2, std::vector pointsZ1, std::vector pointsZ2); void Run(); - vtkTransform *GetResult(); + /* + int[3]* GetPoints(); + double[3]* GetScales(); + double GetAngle();*/ private: - std::vector _centerPoint; - double _angle; - double _scaleX; - double _scaleY; - double _scaleZ; - //vtkImageData *_image; - vtkTransform *_transform;*/ + //float[3] _points; + + int _pointx1a; + int _pointx1b; + int _pointx2a; + int _pointx2b; + + int _pointy1a; + int _pointy1b; + int _pointy2a; + int _pointy2b; + + int _pointz1a; + int _pointz1b; + int _pointz2a; + int _pointz2b; + + vtkMath *_math; }; #endif \ No newline at end of file