]> Creatis software - creaVtk.git/commitdiff
#3110 creaVtk Bug New Normal - branch vtk7itk4 compilation with vtk7 vtk7itk4
authorEduardo DAVILA <davila@localhost.localdomain>
Fri, 25 Aug 2017 15:56:03 +0000 (17:56 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Fri, 25 Aug 2017 15:56:03 +0000 (17:56 +0200)
12 files changed:
bbtk_creaVtk_PKG/bbs/appli/ExampleTransformVector.bbg [new file with mode: 0644]
bbtk_creaVtk_PKG/bbs/appli/ExampleTransformVector.bbs [new file with mode: 0644]
bbtk_creaVtk_PKG/bbs/appli/exampleVectorsExploration_Widget.bbg [new file with mode: 0644]
bbtk_creaVtk_PKG/bbs/appli/exampleVectorsExploration_Widget.bbs [new file with mode: 0644]
bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensors_manualread_Widget.bbg [new file with mode: 0644]
bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensors_manualread_Widget.bbs [new file with mode: 0644]
bbtk_creaVtk_PKG/bbs/appli/exampleVectorsVisu_Widget.bbg [new file with mode: 0644]
bbtk_creaVtk_PKG/bbs/appli/exampleVectorsVisu_Widget.bbs [new file with mode: 0644]
bbtk_creaVtk_PKG/src/bbcreaVtkUnMosaicVectorVtkImageData.h
bbtk_creaVtk_PKG/src/bbcreaVtkVectorsExtraction.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkVectorsExtraction.h
lib/creaVtk/creaVtkUnMosaicVectorVtkImageData.cpp

diff --git a/bbtk_creaVtk_PKG/bbs/appli/ExampleTransformVector.bbg b/bbtk_creaVtk_PKG/bbs/appli/ExampleTransformVector.bbg
new file mode 100644 (file)
index 0000000..aedd47d
--- /dev/null
@@ -0,0 +1,79 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/ExampleTransformVector.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:6
+BOX
+creaVtk:TransformVector:Box00
+ISEXEC:FALSE
+-10.219737:10.520318:-900.000000
+31.830263:0.520318:-900.000000
+PORT
+InX:"0 10 20 30 40"
+PORT
+InY:"0 0 0 0 0"
+PORT
+InZ:"0 0 0 0 0"
+FIN_BOX
+BOX
+vtk:Transform:Box01
+ISEXEC:FALSE
+3.907547:36.670822:-900.000000
+39.482547:26.670822:-900.000000
+PORT
+RotateWXYZ:"45 0 0 1"
+FIN_BOX
+BOX
+wx:OutputText:Box02
+ISEXEC:FALSE
+-32.763275:-20.740055:-900.000000
+4.011725:-30.740055:-900.000000
+FIN_BOX
+BOX
+wx:OutputText:Box03
+ISEXEC:FALSE
+8.577941:-39.514940:-900.000000
+45.352941:-49.514940:-900.000000
+FIN_BOX
+BOX
+wx:OutputText:Box04
+ISEXEC:FALSE
+60.578368:-42.821325:-900.000000
+97.353368:-52.821325:-900.000000
+FIN_BOX
+BOX
+wx:LayoutLine:Box05
+ISEXEC:TRUE
+-7.514513:-74.543965:-900.000000
+50.045487:-84.543965:-900.000000
+FIN_BOX
+CONNECTIONS:7
+CONNECTION
+Box01:Out:Box00:Transform
+NumberOfControlPoints:0
+CONNECTION
+Box00:OutX:Box02:In
+NumberOfControlPoints:0
+CONNECTION
+Box02:Widget:Box05:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box03:Widget:Box05:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box04:Widget:Box05:Widget3
+NumberOfControlPoints:0
+CONNECTION
+Box00:OutY:Box03:In
+NumberOfControlPoints:0
+CONNECTION
+Box00:OutZ:Box04:In
+NumberOfControlPoints:0
+APP_END
diff --git a/bbtk_creaVtk_PKG/bbs/appli/ExampleTransformVector.bbs b/bbtk_creaVtk_PKG/bbs/appli/ExampleTransformVector.bbs
new file mode 100644 (file)
index 0000000..75474cc
--- /dev/null
@@ -0,0 +1,53 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/ExampleTransformVector.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include creaVtk
+include vtk
+include wx
+
+author "Author ??"
+description "Description ??"
+category "<VOID>"
+
+new creaVtk:TransformVector Box00
+  set Box00.InX "0 10 20 30 40"
+  set Box00.InY "0 0 0 0 0"
+  set Box00.InZ "0 0 0 0 0"
+
+new vtk:Transform Box01
+  set Box01.RotateWXYZ "45 0 0 1"
+
+new wx:OutputText Box02
+
+new wx:OutputText Box03
+
+new wx:OutputText Box04
+
+new wx:LayoutLine Box05
+
+
+connect Box01.Out Box00.Transform
+
+connect Box00.OutX Box02.In
+
+connect Box02.Widget Box05.Widget1
+
+connect Box03.Widget Box05.Widget2
+
+connect Box04.Widget Box05.Widget3
+
+connect Box00.OutY Box03.In
+
+connect Box00.OutZ Box04.In
+
+
+
+# Complex input ports
+exec Box05
diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsExploration_Widget.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsExploration_Widget.bbg
new file mode 100644 (file)
index 0000000..7b82938
--- /dev/null
@@ -0,0 +1,81 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsExploration_Widget.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:7
+BOX
+creaVtk:VectorsExploration_Widget:Box05
+ISEXEC:FALSE
+-44.335624:-18.635991:-900.000000
+7.914376:-28.635991:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:Box06
+ISEXEC:FALSE
+23.896150:19.838313:-900.000000
+87.616150:9.838313:-900.000000
+FIN_BOX
+BOX
+vtk:LoadHola:Box07
+ISEXEC:FALSE
+25.399053:55.607393:-900.000000
+60.949053:45.607393:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box08
+ISEXEC:FALSE
+-62.370455:29.757470:-900.000000
+-22.645455:19.757470:-900.000000
+PORT
+In2:"/creaVtk/Vectors.vtk"
+FIN_BOX
+BOX
+std:Configuration:Box09
+ISEXEC:FALSE
+-44.035044:51.399266:-900.000000
+-4.610044:41.399266:-900.000000
+FIN_BOX
+BOX
+vtk:StructuredPointsReader:Box10
+ISEXEC:FALSE
+-62.069874:10.820898:-900.000000
+-13.369874:0.820898:-900.000000
+FIN_BOX
+BOX
+wx:LayoutSplit:Box11
+ISEXEC:TRUE
+-8.566544:-57.410876:-900.000000
+30.513456:-67.410876:-900.000000
+PORT
+Orientation:"H"
+FIN_BOX
+CONNECTIONS:7
+CONNECTION
+Box06:Renderer1:Box05:vtkRenderer
+NumberOfControlPoints:0
+CONNECTION
+Box07:Out:Box06:In
+NumberOfControlPoints:0
+CONNECTION
+Box09:DataPath:Box08:In1
+NumberOfControlPoints:0
+CONNECTION
+Box08:Out:Box10:In
+NumberOfControlPoints:0
+CONNECTION
+Box10:Out:Box05:vtkImageData_vectors
+NumberOfControlPoints:0
+CONNECTION
+Box05:widget:Box11:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box06:Widget:Box11:Widget2
+NumberOfControlPoints:0
+APP_END
diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsExploration_Widget.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsExploration_Widget.bbs
new file mode 100644 (file)
index 0000000..c999230
--- /dev/null
@@ -0,0 +1,55 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsExploration_Widget.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include creaVtk
+include creaMaracasVisu
+include vtk
+include std
+include wx
+
+author "Author ??"
+description "Description ??"
+category "<VOID>"
+
+new creaVtk:VectorsExploration_Widget Box05
+
+new creaMaracasVisu:ViewerNV Box06
+
+new vtk:LoadHola Box07
+
+new std:ConcatStrings Box08
+  set Box08.In2 "/creaVtk/Vectors.vtk"
+
+new std:Configuration Box09
+
+new vtk:StructuredPointsReader Box10
+
+new wx:LayoutSplit Box11
+  set Box11.Orientation "H"
+
+
+connect Box06.Renderer1 Box05.vtkRenderer
+
+connect Box07.Out Box06.In
+
+connect Box09.DataPath Box08.In1
+
+connect Box08.Out Box10.In
+
+connect Box10.Out Box05.vtkImageData_vectors
+
+connect Box05.widget Box11.Widget1
+
+connect Box06.Widget Box11.Widget2
+
+
+
+# Complex input ports
+exec Box11
diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensors_manualread_Widget.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensors_manualread_Widget.bbg
new file mode 100644 (file)
index 0000000..ceb87df
--- /dev/null
@@ -0,0 +1,112 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensors_manualread_Widget.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:10
+BOX
+creaVtk:VectorsTensors_manualread_Widget:Box02
+ISEXEC:FALSE
+-103.099113:11.121479:-900.000000
+-41.649113:1.121479:-900.000000
+FIN_BOX
+BOX
+vtk:LoadHola:Box03
+ISEXEC:FALSE
+-32.011824:71.838740:-900.000000
+3.538176:61.838740:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:Box04
+ISEXEC:FALSE
+-42.532141:40.878949:-900.000000
+21.187859:30.878949:-900.000000
+FIN_BOX
+BOX
+wx:LayoutSplit:Box05
+ISEXEC:TRUE
+-90.625022:-42.983012:-900.000000
+-51.545022:-52.983012:-900.000000
+PORT
+Orientation:"H"
+FIN_BOX
+BOX
+wx:OutputText:Box06
+ISEXEC:FALSE
+17.583959:-41.179529:-900.000000
+54.358959:-51.179529:-900.000000
+FIN_BOX
+BOX
+std:Configuration:Box07
+ISEXEC:FALSE
+40.428078:21.040635:-900.000000
+79.853078:11.040635:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box08
+ISEXEC:FALSE
+7.364222:-3.907547:-900.000000
+47.089222:-13.907547:-900.000000
+PORT
+In2:"/creaVtk/Vectors.vtk"
+FIN_BOX
+BOX
+wx:OutputText:Box09
+ISEXEC:FALSE
+58.925175:-40.416681:-900.000000
+95.700175:-50.416681:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box10
+ISEXEC:FALSE
+56.821112:-4.347021:-900.000000
+96.546112:-14.347021:-900.000000
+PORT
+In2:"/creaVtk/Tensors.vtk"
+FIN_BOX
+BOX
+wx:LayoutLine:Box11
+ISEXEC:TRUE
+36.520531:-61.619003:-900.000000
+94.080531:-71.619003:-900.000000
+PORT
+WinHeight:"100"
+FIN_BOX
+CONNECTIONS:10
+CONNECTION
+Box03:Out:Box04:In
+NumberOfControlPoints:0
+CONNECTION
+Box02:widget:Box05:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box04:Renderer1:Box02:vtkRenderer
+NumberOfControlPoints:0
+CONNECTION
+Box04:Widget:Box05:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box07:DataPath:Box08:In1
+NumberOfControlPoints:0
+CONNECTION
+Box08:Out:Box06:In
+NumberOfControlPoints:0
+CONNECTION
+Box07:DataPath:Box10:In1
+NumberOfControlPoints:0
+CONNECTION
+Box10:Out:Box09:In
+NumberOfControlPoints:0
+CONNECTION
+Box06:Widget:Box11:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box09:Widget:Box11:Widget2
+NumberOfControlPoints:0
+APP_END
diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensors_manualread_Widget.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensors_manualread_Widget.bbs
new file mode 100644 (file)
index 0000000..545d8d5
--- /dev/null
@@ -0,0 +1,70 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensors_manualread_Widget.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include creaVtk
+include vtk
+include creaMaracasVisu
+include wx
+include std
+
+author "Author ??"
+description "Description ??"
+category "<VOID>"
+
+new creaVtk:VectorsTensors_manualread_Widget Box02
+
+new vtk:LoadHola Box03
+
+new creaMaracasVisu:ViewerNV Box04
+
+new wx:LayoutSplit Box05
+  set Box05.Orientation "H"
+
+new wx:OutputText Box06
+
+new std:Configuration Box07
+
+new std:ConcatStrings Box08
+  set Box08.In2 "/creaVtk/Vectors.vtk"
+
+new wx:OutputText Box09
+
+new std:ConcatStrings Box10
+  set Box10.In2 "/creaVtk/Tensors.vtk"
+
+new wx:LayoutLine Box11
+  set Box11.WinHeight "100"
+
+
+connect Box03.Out Box04.In
+
+connect Box02.widget Box05.Widget1
+
+connect Box04.Renderer1 Box02.vtkRenderer
+
+connect Box04.Widget Box05.Widget2
+
+connect Box07.DataPath Box08.In1
+
+connect Box08.Out Box06.In
+
+connect Box07.DataPath Box10.In1
+
+connect Box10.Out Box09.In
+
+connect Box06.Widget Box11.Widget1
+
+connect Box09.Widget Box11.Widget2
+
+
+
+# Complex input ports
+exec Box05
+exec Box11
diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsVisu_Widget.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsVisu_Widget.bbg
new file mode 100644 (file)
index 0000000..0c6cedf
--- /dev/null
@@ -0,0 +1,81 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsVisu_Widget.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:7
+BOX
+creaVtk:VectorsVisu_Widget:Box00
+ISEXEC:FALSE
+-23.144699:0.601161:-900.000000
+22.280301:-9.398839:-900.000000
+FIN_BOX
+BOX
+vtk:LoadHola:Box01
+ISEXEC:FALSE
+35.769080:65.526550:-900.000000
+71.319080:55.526550:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:Box02
+ISEXEC:FALSE
+20.740055:22.242957:-900.000000
+84.460055:12.242957:-900.000000
+FIN_BOX
+BOX
+vtk:StructuredPointsReader:Box03
+ISEXEC:FALSE
+-48.393461:24.948182:-900.000000
+0.306539:14.948182:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box04
+ISEXEC:FALSE
+-42.381851:45.387656:-900.000000
+-2.656851:35.387656:-900.000000
+PORT
+In2:"/creaVtk/Vectors.vtk"
+FIN_BOX
+BOX
+std:Configuration:Box05
+ISEXEC:FALSE
+-36.670822:64.925389:-900.000000
+2.754178:54.925389:-900.000000
+FIN_BOX
+BOX
+wx:LayoutSplit:Box06
+ISEXEC:TRUE
+12.323801:-42.081271:-900.000000
+51.403801:-52.081271:-900.000000
+PORT
+Orientation:"H"
+FIN_BOX
+CONNECTIONS:7
+CONNECTION
+Box01:Out:Box02:In
+NumberOfControlPoints:0
+CONNECTION
+Box02:Renderer1:Box00:renderer
+NumberOfControlPoints:0
+CONNECTION
+Box04:Out:Box03:In
+NumberOfControlPoints:0
+CONNECTION
+Box05:DataPath:Box04:In1
+NumberOfControlPoints:0
+CONNECTION
+Box03:Out:Box00:vtkDataObject
+NumberOfControlPoints:0
+CONNECTION
+Box02:Widget:Box06:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box00:Widget:Box06:Widget1
+NumberOfControlPoints:0
+APP_END
diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsVisu_Widget.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsVisu_Widget.bbs
new file mode 100644 (file)
index 0000000..1456ef1
--- /dev/null
@@ -0,0 +1,55 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsVisu_Widget.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include creaVtk
+include vtk
+include creaMaracasVisu
+include std
+include wx
+
+author "Author ??"
+description "Description ??"
+category "<VOID>"
+
+new creaVtk:VectorsVisu_Widget Box00
+
+new vtk:LoadHola Box01
+
+new creaMaracasVisu:ViewerNV Box02
+
+new vtk:StructuredPointsReader Box03
+
+new std:ConcatStrings Box04
+  set Box04.In2 "/creaVtk/Vectors.vtk"
+
+new std:Configuration Box05
+
+new wx:LayoutSplit Box06
+  set Box06.Orientation "H"
+
+
+connect Box01.Out Box02.In
+
+connect Box02.Renderer1 Box00.renderer
+
+connect Box04.Out Box03.In
+
+connect Box05.DataPath Box04.In1
+
+connect Box03.Out Box00.vtkDataObject
+
+connect Box02.Widget Box06.Widget2
+
+connect Box00.Widget Box06.Widget1
+
+
+
+# Complex input ports
+exec Box06
index 4b4e2760af8a6bd1a18c36b5dc94ff89f6db1f62..7da041e3971de06ee3a430c65c49609681d2c496 100644 (file)
@@ -27,13 +27,15 @@ class bbcreaVtk_EXPORT UnMosaicVectorVtkImageData
 };
 
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(UnMosaicVectorVtkImageData,bbtk::AtomicBlackBox);
-BBTK_NAME("UnMosaicVectorVtkImageData");
-BBTK_AUTHOR("carlos torres");
-BBTK_DESCRIPTION("No Description.");
-BBTK_CATEGORY("empty");
-BBTK_INPUT(UnMosaicVectorVtkImageData,In,"2D image list",std::vector<vtkImageData*>,"");
-BBTK_INPUT(UnMosaicVectorVtkImageData,NbImagesInMosaicVector,"Vector of Number of Images In Mosaic ",std::vector<int>,"");
-BBTK_OUTPUT(UnMosaicVectorVtkImageData,Out,"3D image Vector",std::vector<vtkImageData*>,"");
+  BBTK_NAME("UnMosaicVectorVtkImageData");
+  BBTK_AUTHOR("carlos torres");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+
+  BBTK_INPUT(UnMosaicVectorVtkImageData,In,"2D image list",std::vector<vtkImageData*>,"");
+  BBTK_INPUT(UnMosaicVectorVtkImageData,NbImagesInMosaicVector,"Vector of Number of Images In Mosaic ",std::vector<int>,"");
+
+  BBTK_OUTPUT(UnMosaicVectorVtkImageData,Out,"3D image Vector",std::vector<vtkImageData*>,"");
 BBTK_END_DESCRIBE_BLACK_BOX(UnMosaicVectorVtkImageData);
 //===== 
 // 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)
index 38f2ffb1e9c8f34d1712daf04c3578bad6a550a8..33b2347ddf962cad47e285e157226befa185f0a8 100644 (file)
@@ -28,68 +28,79 @@ void VectorsExtraction::Process()
 //      (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')
-    std::cout<< "MLER VectorsExtraction Process Start" << std::endl;
-
+std::cout<< "MLER VectorsExtraction Process Start" << std::endl;
     if(bbGetInputVectorsFieldImage() != NULL )
        {
-               vtkImageData         *m_VectorImage = bbGetInputVectorsFieldImage();
-               vtkIdType             m_idType;
-      vtkDoubleArray       *velocity      = vtkDoubleArray::New();
-
-      std::vector<double> coord           = bbGetInputCoordinates();
-      std::vector<double> vec;
-
-      vec.push_back(0);
-      vec.push_back(0);
-      vec.push_back(0);
-
-      double ang1 = 0;//Angle 1
-      double ang2 = 0;//ANgle 2
-      double comp = 0;//Component x + y
+               vtkImageData            *m_VectorImage = bbGetInputVectorsFieldImage();
+               vtkIdType               m_idType;
+       vtkDoubleArray          *velocity      = vtkDoubleArray::New();
+       std::vector<double>     coord          = bbGetInputCoordinates();
+       std::vector<double>     vec;
+       vec.push_back(0);
+       vec.push_back(0);
+       vec.push_back(0);
+       double ang1 = 0;//Angle 1
+       double ang2 = 0;//ANgle 2
+       double comp = 0;//Component x + y
+       //Find coordinate into the image      
+std::cout << "ups ." << std::endl;
+       m_idType = m_VectorImage->FindPoint(coord[0],coord[1],coord[2]);
+std::cout << "m_idType" << m_idType << std::endl;
+       //Recuperate vector of vectorFieldImage
+               m_VectorImage->Print(std::cout);
+
+
+               int sizeArrays= m_VectorImage->GetPointData()->GetNumberOfArrays();
+               for (int iArray=0; iArray<sizeArrays;iArray++)
+               {
+                       printf("%s\n", m_VectorImage->GetPointData()->GetArrayName(iArray) );
+               } // for iArrays
+
+vtkDataArray *dataArray = m_VectorImage->GetPointData()->GetArray("velocity");
+if (dataArray!=NULL)
+{
+       printf("DataArrya ok \n");      
+       double *vecData;
+       vecData=dataArray->GetTuple3(m_idType);
+       printf("info data: %f %f %f \n", vecData[0], vecData[1], vecData[2] );
+       vec[0]=vecData[0];
+       vec[1]=vecData[1];
+       vec[2]=vecData[2];
+       bbSetOutputVector(vec);
 
-      //Find coordinate into the image      
-      m_idType = m_VectorImage->FindPoint(coord[0],coord[1],coord[2]);
-      std::cout << m_idType;
+} // if dataArray
 
-      //Recuperate vector of vectorFieldImage
                velocity = vtkDoubleArray::SafeDownCast(m_VectorImage->GetPointData()->GetArray("velocity"));
-      //velocity->Print(std::cout);
-
-      std::cout<< "# components velocity: " << velocity->GetNumberOfComponents()<<std::endl;
-      std::cout<< "# tuples velocity: " << velocity->GetNumberOfTuples()<<std::endl;
-
-      vec[0] = velocity->GetComponent(m_idType,0);
-      vec[1] = velocity->GetComponent(m_idType,1);
-      vec[2] = velocity->GetComponent(m_idType,2);
-
-      std::cout << "velocity :" << vec[0] << "," <<vec[1] << ","<< vec[2] << std::endl;
-
-
-      //Miss calcule of angles -----
-      comp = sqrt((vec[0]*vec[0])+(vec[1]*vec[1]));
-      
-      ang1 = atan2(vec[2],comp) * 180 / PI;
-
-
-      ang2 = atan2(vec[1],vec[0]) * 180 / PI;
-
-      
-               //m_VectorImage->Print(std::cout);
-
-      std::cout << "ang1: " << ang1 << std::endl;
-      std::cout << "ang2: " << ang2 << std::endl;
-
-       bbSetOutputAngle1(ang1);
-       bbSetOutputAngle2(ang2);
-      bbSetOutputVector(vec);
-      bbSetOutputX(coord[0]);
-      bbSetOutputY(coord[1]);
-      bbSetOutputZ(coord[2]);
-
+       //velocity->Print(std::cout);
+               if (velocity!=NULL)
+               {
+       std::cout<< "# components velocity: " << velocity->GetNumberOfComponents()<<std::endl;
+       std::cout<< "# tuples velocity: " << velocity->GetNumberOfTuples()<<std::endl;
+                       vec[0] = velocity->GetComponent(m_idType,0);
+                       vec[1] = velocity->GetComponent(m_idType,1);
+                       vec[2] = velocity->GetComponent(m_idType,2);
+       std::cout << "velocity :" << vec[0] << "," <<vec[1] << ","<< vec[2] << std::endl;
+                       //Miss calcule of angles -----
+                       comp = sqrt((vec[0]*vec[0])+(vec[1]*vec[1]));
+                       ang1 = atan2(vec[2],comp) * 180 / PI;
+                       ang2 = atan2(vec[1],vec[0]) * 180 / PI;
+                       //m_VectorImage->Print(std::cout);
+       std::cout << "ang1: " << ang1 << std::endl;
+       std::cout << "ang2: " << ang2 << std::endl;
+                       bbSetOutputAngle1(ang1);
+                       bbSetOutputAngle2(ang2);
+                       bbSetOutputVector(vec);
+                       bbSetOutputX(coord[0]);
+                       bbSetOutputY(coord[1]);
+                       bbSetOutputZ(coord[2]);
+
+               } else {
+                       bbSetOutputAngle1(ang1);
+                       bbSetOutputAngle2(ang2);
+                       bbSetOutputVector(vec);
+               }// if velocity
        }// if image != NULL
-    
-    std::cout<< "MLER VectorsExtraction Process END" << std::endl;
-  
+std::cout<< "MLER VectorsExtraction Process END" << std::endl;  
 }
 //===== 
 // 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)
index d7770f82fc5c9b2e035a755728a0dfa777afd740..f190d313638cffb357e175d29c532d13dbf4d125 100644 (file)
@@ -40,18 +40,18 @@ class bbcreaVtk_EXPORT VectorsExtraction
 };
 
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(VectorsExtraction,bbtk::AtomicBlackBox);
-BBTK_NAME("VectorsExtraction");
-BBTK_AUTHOR("Monica ESPINOSA");
-BBTK_DESCRIPTION("No Description.");
-BBTK_CATEGORY("empty");
-BBTK_INPUT(VectorsExtraction,Coordinates,"Coordinates (x,y,z)",std::vector<double>,"");
-BBTK_INPUT(VectorsExtraction,VectorsFieldImage,"Image of Vectors Field",vtkImageData*,"");
-BBTK_OUTPUT(VectorsExtraction,Vector,"",std::vector<double>,"");
-BBTK_OUTPUT(VectorsExtraction,X,"x",double,"");
-BBTK_OUTPUT(VectorsExtraction,Y,"y",double,"");
-BBTK_OUTPUT(VectorsExtraction,Z,"z",double,"");
-BBTK_OUTPUT(VectorsExtraction,Angle1,"Angle 1 (Helix Angle)",double,"");
-BBTK_OUTPUT(VectorsExtraction,Angle2,"Angle 2 (Transversal Angle)",double,"");
+  BBTK_NAME("VectorsExtraction");
+  BBTK_AUTHOR("Monica ESPINOSA");
+  BBTK_DESCRIPTION("Warning! looking ofr a 'velocity' array. BOX NOT TESTED!");
+  BBTK_CATEGORY("empty");
+  BBTK_INPUT(VectorsExtraction,Coordinates,"Coordinates (x,y,z)",std::vector<double>,"");
+  BBTK_INPUT(VectorsExtraction,VectorsFieldImage,"Image of Vectors Field",vtkImageData*,"");
+  BBTK_OUTPUT(VectorsExtraction,Vector,"",std::vector<double>,"");
+  BBTK_OUTPUT(VectorsExtraction,X,"x",double,"");
+  BBTK_OUTPUT(VectorsExtraction,Y,"y",double,"");
+  BBTK_OUTPUT(VectorsExtraction,Z,"z",double,"");
+  BBTK_OUTPUT(VectorsExtraction,Angle1,"Angle 1 (Helix Angle)",double,"");
+  BBTK_OUTPUT(VectorsExtraction,Angle2,"Angle 2 (Transversal Angle)",double,"");
 BBTK_END_DESCRIBE_BLACK_BOX(VectorsExtraction);
 //===== 
 // 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)
index 2226f2d4b0b7bd0922235ba6d26579155ab6a06f..93faba51325d36df492f786bc2c5283684e52ddc 100644 (file)
@@ -43,14 +43,12 @@ std::vector<vtkImageData*> creaVtkUnMosaicVectorVtkImageData::unMosaicVectorVtkI
        std::vector<int> nbImagesPerRow;
        std::vector<int> nbImagesInMosaic;
        double imagesInMosaic;
-
        for(int i = 0; i < NbImagesInMosaicVector.size(); i++)
        {
                imagesInMosaic = NbImagesInMosaicVector[i];
                nbImagesPerRow.push_back( ceil(sqrt(imagesInMosaic)) );
                nbImagesInMosaic.push_back(NbImagesInMosaicVector[i]);
-       }
-
+       } // for i
        if(imageInput.size() != NbImagesInMosaicVector.size())
        {
                for(int j = NbImagesInMosaicVector.size(); j < imageInput.size(); j++)  
@@ -58,42 +56,38 @@ std::vector<vtkImageData*> creaVtkUnMosaicVectorVtkImageData::unMosaicVectorVtkI
                        imagesInMosaic = NbImagesInMosaicVector[NbImagesInMosaicVector.size()-1];
                        nbImagesPerRow.push_back( ceil(sqrt(imagesInMosaic)) );         
                        nbImagesInMosaic.push_back( NbImagesInMosaicVector[NbImagesInMosaicVector.size()-1] );
-               }
-       }
-       
+               } // for j
+       } // for imageInput size
        if (nbImagesPerRow.size() == 0 || nbImagesInMosaic.size() == 0) 
-        {
+    {
                std::cout << "VtkUnMosaicVectorVtkImageData ERROR: The number of Images by mosaic is not set " << std::endl; 
-       }
-
+       } // if nbImagesPerRow size
        std::vector<vtkImageData*> imageIn = imageInput;
-
        std::vector<vtkImageData*> mImageOut;
-       for (int i = 0 ; i < (unsigned int)imageIn.size() ; i++) {
-                       mImageOut.push_back( unMosaic(imageIn[i], nbImagesPerRow[i], nbImagesInMosaic[i]) );
-       }
-
+       for (int i = 0 ; i < (unsigned int)imageIn.size() ; i++) 
+       {
+               mImageOut.push_back( unMosaic(imageIn[i], nbImagesPerRow[i], nbImagesInMosaic[i]) );
+       } // for i
        return mImageOut;       
 }
 
+//------------------------------------------------------------------------------
 vtkImageData * creaVtkUnMosaicVectorVtkImageData::unMosaic(vtkImageData *imageIn, int nbImagesPerRow, int numberOfImagesInMosaic)
 {   
-   int inputdims[3];
-   int outputdims[3];
-   imageIn->GetDimensions (inputdims);
-   unsigned short *input = (unsigned short *)(imageIn->GetScalarPointer());
-
+       int inputdims[3];
+       int outputdims[3];
+       imageIn->GetDimensions (inputdims);
+       unsigned short *input = (unsigned short *)(imageIn->GetScalarPointer());
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
-   imageIn->Update();
+       imageIn->Update();
 #else
-   imageIn->Modified();
-#endif
-     
-   unsigned int div = (unsigned int)ceil(sqrt( (double)numberOfImagesInMosaic ) );
-   outputdims[0] = inputdims[0] / div;
-   outputdims[1] = inputdims[1] / div;
-   outputdims[2] = numberOfImagesInMosaic;
+       // ..
+#endif 
+       unsigned int div = (unsigned int)ceil(sqrt( (double)numberOfImagesInMosaic ) );
+       outputdims[0] = inputdims[0] / div;
+       outputdims[1] = inputdims[1] / div;
+       outputdims[2] = numberOfImagesInMosaic;
  
     vtkImageData *vtkImageOut;
     vtkImageOut = vtkImageData::New();
@@ -111,10 +105,7 @@ vtkImageData * creaVtkUnMosaicVectorVtkImageData::unMosaic(vtkImageData *imageIn
 #else
     vtkImageOut->AllocateScalars(VTK_UNSIGNED_SHORT,1);
 #endif
-
-
     unsigned short *output =(unsigned short *)(vtkImageOut->GetScalarPointer());
-
     unsigned short *dest = output;
     int dimXImageElem = outputdims[0];
     int dimYImageElem = outputdims[1];
@@ -131,18 +122,8 @@ vtkImageData * creaVtkUnMosaicVectorVtkImageData::unMosaic(vtkImageData *imageIn
           memcpy(dest, input+debImage, dimXImageElem*sizeof(unsigned short));
           debImage += dimXImageElem*nbImagesPerRow;
           dest += dimXImageElem;
-       }
-    }
+       } // for j
+    } // for i
     return  vtkImageOut;    
 }
 
-//---------------------------------------------
-//Method template
-//---------------------------------------------
-/*
-void creaVtkUnMosaicVectorVtkImageData::FunctionName(int& parameterA)
-{
-  parameterA = 2 * parameterA;
-  return;
-}
-*/