]> Creatis software - creaVtk.git/commitdiff
2387 creaVtk Feature New Normal New box, lib, script ImageDataStructuredPoints
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Fri, 27 Jun 2014 13:32:01 +0000 (15:32 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Fri, 27 Jun 2014 13:32:01 +0000 (15:32 +0200)
bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Widget.bbg
bbtk_creaVtk_PKG/src/bbcreaVtkImageDataStructuredPoints.h
lib/creaVtk/creaVtkStreamLine.cpp
lib/creaVtk/vtkImageDataStrucPoints.cpp
lib/creaVtk/vtkVectorsTensorsVisuBase.cpp

index 5021db81cb1a3e60916cf9a305d8cf0d3b5921b2..0d4cfd6c28c4bbaba9d8cd2ad88fb4fa939a8a66 100644 (file)
@@ -13,16 +13,16 @@ PACKAGENAME:creaVtk
 COMPLEXOUTPUTS:2
 COMPLEX_PORT
 Widget
-43.902100:-98.162712:-900.000000
+-2.239362:-103.517011:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 boxchange
-2.719569:-99.199517:-900.000000
+-21.059819:-100.774311:-900.000000
 FIN_COMPLEX_PORT
 COMPLEXINPUTS:2
 COMPLEX_PORT
 Renderer
--76.250351:96.135240:-900.000000
+27.686049:87.001435:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 In
@@ -42,8 +42,8 @@ FIN_BOX
 BOX
 creaVtk:PlaneWidget:Box01
 ISEXEC:FALSE
--21.579484:-8.987179:-900.000000
-23.995516:-18.987179:-900.000000
+15.270694:-28.357144:-900.000000
+60.845694:-38.357144:-900.000000
 PORT
 Active:"true"
 PORT
@@ -52,20 +52,20 @@ FIN_BOX
 BOX
 std:MagicBox:Box02
 ISEXEC:FALSE
--75.688060:56.627905:-900.000000
--30.113060:46.627905:-900.000000
+21.476726:47.966538:-900.000000
+67.051726:37.966538:-900.000000
 FIN_BOX
 BOX
 creaVtk:PlaneWidget_StreamLineVisu_Interface:Box03
 ISEXEC:FALSE
--1.056909:57.144870:-900.000000
-70.118091:47.144870:-900.000000
+-76.332059:46.908709:-900.000000
+-5.157059:36.908709:-900.000000
 FIN_BOX
 BOX
 vtk:vtkImageDataPointerRelay:Box04
 ISEXEC:FALSE
-92.104177:56.032598:-900.000000
-163.279177:46.032598:-900.000000
+81.238099:47.686190:-900.000000
+152.413099:37.686190:-900.000000
 FIN_BOX
 CONNECTIONS:17
 CONNECTION
index 93d6d406b5f587d1d85f9bfc64f1c11a1d0ccbbe..c679b5211871584961ebc4711f34f46e1a926b79 100644 (file)
@@ -24,7 +24,7 @@ class bbcreaVtk_EXPORT ImageDataStructuredPoints
   BBTK_DECLARE_INPUT(X, vtkImageData*);
   BBTK_DECLARE_INPUT(Y, vtkImageData*);
   BBTK_DECLARE_INPUT(Z, vtkImageData*);
-  BBTK_DECLARE_OUTPUT(ImageEnsemble,  vtkStructuredPoints*);
+  BBTK_DECLARE_OUTPUT(ImageEnsemble,  vtkImageData*);
   BBTK_PROCESS(Process);
   void Process();
 //===== 
@@ -40,7 +40,7 @@ BBTK_CATEGORY("empty");
 BBTK_INPUT(ImageDataStructuredPoints,X,"Image X",vtkImageData*,"");
 BBTK_INPUT(ImageDataStructuredPoints,Y,"Image Y",vtkImageData*,"");
 BBTK_INPUT(ImageDataStructuredPoints,Z,"Image Z",vtkImageData*,"");
-BBTK_OUTPUT(ImageDataStructuredPoints,ImageEnsemble,"Image Ensemble",vtkStructuredPoints*,"");
+BBTK_OUTPUT(ImageDataStructuredPoints,ImageEnsemble,"Image Ensemble",vtkImageData*,"");
 BBTK_END_DESCRIBE_BLACK_BOX(ImageDataStructuredPoints);
 //===== 
 // 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 6f213f92e2f94d33883f4d3655e347e6357dd85f..5085b1da5cb2bc992b18cc48f91b477853de141b 100644 (file)
@@ -102,6 +102,10 @@ printf("creaVtkStreamLine::Process Start \n");
 printf("EED creaVtkStreamLine::Process StreamLine PrintSelf\n");
                        _streamer->Print(std::cout);
 
+printf("EED creaVtkStreamLine::Process StreamLine->GetOutput() PrintSelf\n");
+                       _streamer->GetOutput()->Print(std::cout);
+
+
 //EED 3aout2011
                        _tubefilter->SetInput(_streamer->GetOutput());
                        _tubefilter->SetRadius( GetScaleFactor() );
@@ -166,6 +170,7 @@ printf("EED creaVtkStreamLine::Process StreamLine PrintSelf\n");
                        
                        _actor->SetMapper( _streamMapper2 );
 
+printf("EED lib creaVTK creaVtkStreamLine::Process  opacity %f\n", GetOpacity() );
                        _actor->GetProperty()->SetOpacity( GetOpacity() );
                }// _active
        
index 69ac58ab0f56585f75c3c27c30c14de10a0de422..3678f7fd3eb60d57eb4cd0e87dc91582c73cc33f 100644 (file)
@@ -26,6 +26,8 @@
 */
 
 #include "vtkImageDataStrucPoints.h"
+#include "vtkStructuredPointsWriter.h"
+
 
 vtkImageDataStrucPoints::vtkImageDataStrucPoints()
 {
@@ -49,13 +51,10 @@ void vtkImageDataStrucPoints::joinComponents(vtkImageData* imageX, vtkImageData*
 
        imageY->GetSpacing(spc);
 
-       vtkDoubleArray *arrayX;
-       vtkDoubleArray *arrayY;
-       vtkDoubleArray *arrayZ;
 
-   unsigned char *ptrUCharX = (unsigned char *)imageX->GetScalarPointer();
-   unsigned char *ptrUCharY = (unsigned char *)imageY->GetScalarPointer();
-   unsigned char *ptrUCharZ = (unsigned char *)imageZ->GetScalarPointer();
+   double *ptrUCharX = (double *)imageX->GetScalarPointer();
+   double *ptrUCharY = (double *)imageY->GetScalarPointer();
+   double *ptrUCharZ = (double *)imageZ->GetScalarPointer();
 
         long int sizeimage = dim[0]*dim[1]*dim[2];
 
@@ -70,26 +69,43 @@ void vtkImageDataStrucPoints::joinComponents(vtkImageData* imageX, vtkImageData*
         double vz;
 
   int i;
+
+printf("EED  vtkImageDataStrucPoints::joinComponents  sizeimage%d\n", sizeimage );
        for( i = 0 ; i < sizeimage ; i++ )
        {
-                       vx = *ptrUCharX;
-                       vy = *ptrUCharY;
-                       vz = *ptrUCharZ;
-                       ptrUCharX++;
-                       ptrUCharY++;
-                       ptrUCharZ++;
-       array->SetTuple3(i,vx, vy , vz );
+               vx = *ptrUCharX;
+               vy = *ptrUCharY;
+               vz = *ptrUCharZ;
+               ptrUCharX++;
+               ptrUCharY++;
+               ptrUCharZ++;
+               array->SetTuple3(i,vx, vy , vz );
        } // for i
 
-
-
        _structuredPoints = vtkStructuredPoints::New();
        _structuredPoints->SetDimensions(dim[0], dim[1], dim[2]);
        _structuredPoints->SetSpacing(spc);
-       _structuredPoints->SetScalarTypeToFloat();
-       _structuredPoints->SetNumberOfScalarComponents(1);
+       _structuredPoints->SetScalarTypeToDouble();
+       _structuredPoints->SetNumberOfScalarComponents(3);
        _structuredPoints->GetPointData()->SetVectors(array);
        _structuredPoints->GetPointData()->SetNumberOfTuples(sizeimage);
+       _structuredPoints->Modified();
+       _structuredPoints->Update();
+
+       _structuredPoints->Print(cout);
+
+        vtkStructuredPointsWriter *writer2 = vtkStructuredPointsWriter::New();
+       writer2->SetFileName("/home/davila/tmp/VectorfromCal_EED_ups.vtk");
+       //writer->SetFileTypeToBinary();
+       writer2->SetFileTypeToASCII();
+       writer2->SetTensorsName("VectorfromCal");
+       writer2->SetFieldDataName("GlyphVector");
+       writer2->SetScalarsName("Scalar");
+       writer2->SetInput(_structuredPoints);  
+       writer2->Write();  
+
+
+
 
 }
 
index f582efe2851e0e412815a4e9615c2ba77cae9c4f..405d741b32294ff3a936cb7bcc29967d591e31ed 100644 (file)
@@ -210,7 +210,12 @@ vtkVectorsTensorsVisuBase::vtkVectorsTensorsVisuBase()
        _typeForm       = 0;
 
        _LutEED         = vtkLookupTableDirectionVector::New();
-       _LutEED->SetVectorMode(0);
+//     _LutEED->SetVectorMode(0);
+//_LutEED->SetVectorModeToMagnitude();
+//_LutEED->SetVectorModeToComponent();
+_LutEED->SetVectorModeToRGBColors();
+
+
 
        _pdm            = vtkPolyDataMapper::New();
        _actor          = vtkActor::New();