]> Creatis software - creaVtk.git/commitdiff
#3110 creaVtk Bug New Normal - branch vtk7itk4 compilation with vtk7
authorEduardo DAVILA <davila@localhost.localdomain>
Fri, 4 Aug 2017 13:28:56 +0000 (15:28 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Fri, 4 Aug 2017 13:28:56 +0000 (15:28 +0200)
16 files changed:
bbtk_creaVtk_PKG/src/bbcreaVtkImageAccumulate.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousDilate3D.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkImageExtractComponents.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkImageSlab.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkReadMHDPlane.cxx
lib/creaVtk/creaVtkPlaneWidget.cpp
lib/creaVtk/creaVtkStreamLine.cpp
lib/creaVtk/creaVtkStreamLineScalarSeg.cpp
lib/creaVtk/creaVtkStreamTracer.cpp
lib/creaVtk/creaVtkUnMosaicVectorVtkImageData.cpp
lib/creaVtk/cutImageSegmentation.cpp
lib/creaVtk/vtkImageDataStrucPoints.cpp
lib/creaVtk/vtkStreamLineCreateColorInfo.cpp
lib/creaVtk/vtkTensorsVisu.cpp
lib/creaVtk/vtkVectorsVisu.cpp

index 0e7ea7ccfa2538c6a8903498957be33acfdbbd7b..6007c187875158322764e4fe6af64e2c1a1a890d 100644 (file)
@@ -34,7 +34,12 @@ void ImageAccumulate::Process()
                acc->Delete();
        }
        acc = vtkImageAccumulate::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        acc->SetInput( bbGetInputIn() ); 
+#else
+       acc->SetInputData( bbGetInputIn() ); 
+#endif
        acc->IgnoreZeroOn();
        acc->Update();
        bbSetOutputVoxelCount(acc->GetVoxelCount());
index 815f0294ac6633309016af80a255583a25e120d1..5ed81c769bba5d88a86835d5f54ffada7a8c751d 100644 (file)
@@ -16,7 +16,12 @@ void ImageContinuousDilate3D::Process()
 vtkImageData* ImageContinuousDilate3D::dilateFilterRecursive(vtkImageData* image, int repetitions, double x, double y, double z)
 {
                vtkImageContinuousDilate3D *dilateFilter = vtkImageContinuousDilate3D ::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
     dilateFilter->SetInput (image);
+#else
+    dilateFilter->SetInputData(image);
+#endif
     dilateFilter->SetKernelSize(x, y, z);
                dilateFilter->Modified();               
                dilateFilter->Update();
index 95fd998886d33a2b18c3cef2813331fd64f1db73..ac412460724c5299e3f732806e89afe7342f03d8 100644 (file)
@@ -16,7 +16,12 @@ void ImageContinuousErode3D::Process()
 vtkImageData* ImageContinuousErode3D::erodeFilterRecursive(vtkImageData* image, int repetitions, double x, double y, double z)
 {
                vtkImageContinuousErode3D *erodeFilter = vtkImageContinuousErode3D ::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
     erodeFilter->SetInput (image);
+#else
+    erodeFilter->SetInputData(image);
+#endif
     erodeFilter->SetKernelSize(x, y, z);
                erodeFilter->Modified();                
                erodeFilter->Update();
index d89990567b05e2e6c8e8918a62e9cc64e7ac4413..2769f798ee23f5ef242bb9891f5934e2f646f518 100644 (file)
@@ -36,7 +36,12 @@ void ImageExtractComponents::Process()
 
        if (bbGetInputComponent0()!=-1)
        {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                IEC0->SetInput( bbGetInputIn() );
+#else
+               IEC0->SetInputData( bbGetInputIn() );
+#endif
                IEC0->SetComponents( bbGetInputComponent0() );
                IEC0->Update();
                bbSetOutputOut0( IEC0->GetOutput() ); 
@@ -44,7 +49,12 @@ void ImageExtractComponents::Process()
 
        if (bbGetInputComponent1()!=-1)
        {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                IEC1->SetInput( bbGetInputIn() );
+#else
+               IEC1->SetInputData( bbGetInputIn() );
+#endif
                IEC1->SetComponents( bbGetInputComponent1() );
                IEC1->Update();
                bbSetOutputOut1( IEC1->GetOutput() ); 
@@ -52,7 +62,12 @@ void ImageExtractComponents::Process()
 
        if (bbGetInputComponent2()!=-1)
        {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                IEC2->SetInput( bbGetInputIn() );
+#else
+               IEC2->SetInputData( bbGetInputIn() );
+#endif
                IEC2->SetComponents( bbGetInputComponent2() );
                IEC2->Update();
                bbSetOutputOut2( IEC2->GetOutput() ); 
@@ -60,7 +75,13 @@ void ImageExtractComponents::Process()
 
        if (bbGetInputComponent3()!=-1)
        {
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                IEC3->SetInput( bbGetInputIn() );
+#else
+               IEC3->SetInputData( bbGetInputIn() );
+#endif
                IEC3->SetComponents( bbGetInputComponent2() );
                IEC3->Update();
                bbSetOutputOut3( IEC3->GetOutput() ); 
index 9b9f33d1026c93f9c6d8904e19167afd980d4f6e..08efca987da58b098b4298333252dc52e20e321c 100644 (file)
@@ -40,7 +40,12 @@ void ImageSlab::Process()
        if (bbGetInputType()==2) { imageSlab->SetOperationToMin(); }
        if (bbGetInputType()==3) { imageSlab->SetOperationToMax(); }
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        imageSlab->SetInput( bbGetInputIn() );  
+#else
+       imageSlab->SetInputData( bbGetInputIn() );  
+#endif
        imageSlab->MultiSliceOutputOff();
        imageSlab->SetOutputScalarTypeToInputScalarType();
        bbSetOutputOut( imageSlab->GetOutput() );
index 223fe7e590c57219a95c349e9aca5c81ef77469e..020eb5f9080d0aecff4b85e807382e57172c7029 100644 (file)
@@ -42,14 +42,21 @@ vtkImageData* ReadMHDPlane::CreateDefaultImage()
        sizeZ = 1;
        vtkImageData *newImage = vtkImageData::New();
        newImage->Initialize();
-       newImage->SetScalarTypeToUnsignedChar();
        newImage->SetSpacing( 1,1,1 );
        newImage->SetDimensions(  sizeX,sizeY,sizeZ );
-       newImage->SetWholeExtent(0,  sizeX-1,0,sizeY-1,0,sizeZ-1 );
        newImage->SetExtent(0,  sizeX-1,0,sizeY-1,0,sizeZ-1 );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+       newImage->SetWholeExtent(0,  sizeX-1,0,sizeY-1,0,sizeZ-1 );
+       newImage->SetScalarTypeToUnsignedChar();
        newImage->SetNumberOfScalarComponents(1);
        newImage->AllocateScalars();
        newImage->Update();
+#else
+       newImage->AllocateScalars(VTK_UNSIGNED_CHAR,1);
+#endif
+
        memset ( (void*)newImage->GetScalarPointer(), 0, sizeX*sizeY*1 );
        for (i=0; i<sizeX; i++)
        {
@@ -232,6 +239,7 @@ void ReadMHDPlane::Read64lseek()
        long int        headersize=0;
 
        vtkImageData *newImage=NULL;
+       int imageType;
 
        char mystring[250];
        char strTmp[30];
@@ -256,24 +264,26 @@ void ReadMHDPlane::Read64lseek()
                if (strncmp("HeaderSize",mystring,10)==0)               { sscanf(mystring,"%s %s %ld"           ,strTmp, strTmp, &headersize);                  }
                        if (strncmp("ElementDataFile",mystring,15)==0)  { sscanf(mystring,"%s %s %s"            ,strTmp, strTmp, strTmp2); elementdatafile=strTmp2;             }
 
-               if (strncmp("ElementType = MET_CHAR",mystring,22)==0)                   { newImage->SetScalarTypeToChar();                      dataSize=sizeof(char);                  }
-               if (strncmp("ElementType = VTK_CHAR",mystring,22)==0)                   { newImage->SetScalarTypeToChar();                      dataSize=sizeof(char);                  }
-               if (strncmp("ElementType = MET_UCHAR",mystring,23)==0)                  { newImage->SetScalarTypeToUnsignedChar();      dataSize=sizeof(unsigned char); }
-               if (strncmp("ElementType = VTK_UNSIGNED_CHAR",mystring,31)==0)  { newImage->SetScalarTypeToUnsignedChar();      dataSize=sizeof(unsigned char); }
-               if (strncmp("ElementType = MET_USHORT",mystring,24)==0)                 { newImage->SetScalarTypeToUnsignedShort();     dataSize=sizeof(unsigned short);}
-               if (strncmp("ElementType = VTK_UNSIGNED_SHORT",mystring,32)==0) { newImage->SetScalarTypeToUnsignedShort();     dataSize=sizeof(unsigned short);}
-               if (strncmp("ElementType = MET_SHORT",mystring,23)==0)                  { newImage->SetScalarTypeToShort();                     dataSize=sizeof(short);                 }
-               if (strncmp("ElementType = VTK_SHORT",mystring,23)==0)                  { newImage->SetScalarTypeToShort();                     dataSize=sizeof(short);                 }
-               if (strncmp("ElementType = MET_UINT",mystring,22)==0)                   { newImage->SetScalarTypeToUnsignedInt();       dataSize=sizeof(unsigned int);  }
-               if (strncmp("ElementType = VTK_UNSIGNED_INT",mystring,30)==0)   { newImage->SetScalarTypeToUnsignedInt();       dataSize=sizeof(unsigned int);  }
-               if (strncmp("ElementType = MET_INT",mystring,21)==0)                    { newImage->SetScalarTypeToInt();                       dataSize=sizeof(int);                   }
-               if (strncmp("ElementType = VTK_INT",mystring,21)==0)                    { newImage->SetScalarTypeToInt();                       dataSize=sizeof(int);                   }
-               if (strncmp("ElementType = MET_FLOAT",mystring,23)==0)                  { newImage->SetScalarTypeToFloat();                     dataSize=sizeof(float);                 }
-               if (strncmp("ElementType = VTK_FLOAT",mystring,23)==0)                  { newImage->SetScalarTypeToFloat();                     dataSize=sizeof(float);                 }
-               if (strncmp("ElementType = MET_LONG",mystring,22)==0)                   { newImage->SetScalarTypeToLong();                      dataSize=sizeof(long);                  }
-               if (strncmp("ElementType = VTK_LONG",mystring,22)==0)                   { newImage->SetScalarTypeToLong();                      dataSize=sizeof(long);                  }
-               if (strncmp("ElementType = MET_DOUBLE",mystring,24)==0)                 { newImage->SetScalarTypeToDouble();            dataSize=sizeof(double);                }
-               if (strncmp("ElementType = VTK_DOUBLE",mystring,24)==0)                 { newImage->SetScalarTypeToDouble();            dataSize=sizeof(double);                }
+
+
+                       if (strncmp("ElementType = MET_CHAR",mystring,22)==0)                   { imageType =VTK_CHAR;                   dataSize=sizeof(char);                  }
+                       if (strncmp("ElementType = VTK_CHAR",mystring,22)==0)                   { imageType =VTK_CHAR;                   dataSize=sizeof(char);                  }
+                       if (strncmp("ElementType = MET_UCHAR",mystring,23)==0)                  { imageType =VTK_UNSIGNED_CHAR;  dataSize=sizeof(unsigned char); }
+                       if (strncmp("ElementType = VTK_UNSIGNED_CHAR",mystring,31)==0)  { imageType =VTK_UNSIGNED_CHAR;  dataSize=sizeof(unsigned char); }
+                       if (strncmp("ElementType = MET_USHORT",mystring,24)==0)                 { imageType =VTK_UNSIGNED_SHORT; dataSize=sizeof(unsigned short);}
+                       if (strncmp("ElementType = VTK_UNSIGNED_SHORT",mystring,32)==0) { imageType =VTK_UNSIGNED_SHORT; dataSize=sizeof(unsigned short);}
+                       if (strncmp("ElementType = MET_SHORT",mystring,23)==0)                  { imageType =VTK_SHORT;                  dataSize=sizeof(short);                 }
+                       if (strncmp("ElementType = VTK_SHORT",mystring,23)==0)                  { imageType =VTK_SHORT;                  dataSize=sizeof(short);                 }
+                       if (strncmp("ElementType = MET_UINT",mystring,22)==0)                   { imageType =VTK_UNSIGNED_INT;   dataSize=sizeof(unsigned int);  }
+                       if (strncmp("ElementType = VTK_UNSIGNED_INT",mystring,30)==0)   { imageType =VTK_UNSIGNED_INT;   dataSize=sizeof(unsigned int);  }
+                       if (strncmp("ElementType = MET_INT",mystring,21)==0)                    { imageType =VTK_INT;                    dataSize=sizeof(int);                   }
+                       if (strncmp("ElementType = VTK_INT",mystring,21)==0)                    { imageType =VTK_INT;                    dataSize=sizeof(int);                   }
+                       if (strncmp("ElementType = MET_FLOAT",mystring,23)==0)                  { imageType =VTK_FLOAT;                  dataSize=sizeof(float);                 }
+                       if (strncmp("ElementType = VTK_FLOAT",mystring,23)==0)                  { imageType =VTK_FLOAT;                  dataSize=sizeof(float);                 }
+                       if (strncmp("ElementType = MET_LONG",mystring,22)==0)                   { imageType =VTK_LONG;                   dataSize=sizeof(long);                  }
+                       if (strncmp("ElementType = VTK_LONG",mystring,22)==0)                   { imageType =VTK_LONG;                   dataSize=sizeof(long);                  }
+                       if (strncmp("ElementType = MET_DOUBLE",mystring,24)==0)                 { imageType =VTK_DOUBLE;                 dataSize=sizeof(double);                }
+                       if (strncmp("ElementType = VTK_DOUBLE",mystring,24)==0)                 { imageType =VTK_DOUBLE;                 dataSize=sizeof(double);                }
 
        } // while
                fclose(ffIn);
@@ -312,11 +322,20 @@ void ReadMHDPlane::Read64lseek()
                { 
                        newImage->SetSpacing( spcX,spcY,spcZ );
                        newImage->SetDimensions(  dimX,dimY,width );
-                       newImage->SetWholeExtent(0,  dimX-1,0,dimY-1,0,width-1 );
                        newImage->SetExtent(0,  dimX-1,0,dimY-1,0,width-1 );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+                       newImage->SetWholeExtent(0,  dimX-1,0,dimY-1,0,width-1 );
                        newImage->SetNumberOfScalarComponents(1);
+                       newImage->SetScalarType(imageType);
                        newImage->AllocateScalars();
                        newImage->Update();
+#else
+                       newImage->AllocateScalars( imageType,1 );
+#endif
+
+
                        pos = dimX*dimY*(long long)slice*dataSize;
 #if defined(_WIN32)
                        if (_lseeki64( fd, pos, SEEK_SET ) < 0)
@@ -340,11 +359,18 @@ void ReadMHDPlane::Read64lseek()
                { 
                        newImage->SetSpacing( spcX,spcZ,spcY );
                        newImage->SetDimensions(  dimX,dimZ,width );
-                       newImage->SetWholeExtent(0,  dimX-1,0,dimZ-1,0,width-1 );
                        newImage->SetExtent(0,  dimX-1,0,dimZ-1,0,width-1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+                       newImage->SetWholeExtent(0,  dimX-1,0,dimZ-1,0,width-1 );
                        newImage->SetNumberOfScalarComponents(1);
+                       newImage->SetScalarType(imageType);
                        newImage->AllocateScalars();
                        newImage->Update();
+#else
+                       newImage->AllocateScalars( imageType, 1);
+#endif
+
                        int iWidth;
                        for (iWidth=0;iWidth<width;iWidth++)
                        {
@@ -356,11 +382,18 @@ void ReadMHDPlane::Read64lseek()
                { 
                        newImage->SetSpacing( spcY,spcZ,spcX );
                        newImage->SetDimensions(  dimY,dimZ,width );
-                       newImage->SetWholeExtent(0,  dimY-1,0,dimZ-1,0,width-1 );
                        newImage->SetExtent(0,  dimY-1,0,dimZ-1,0,width-1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+                       newImage->SetWholeExtent(0,  dimY-1,0,dimZ-1,0,width-1 );
                        newImage->SetNumberOfScalarComponents(1);
+                       newImage->SetScalarType(imageType);
                        newImage->AllocateScalars();
                        newImage->Update();
+#else
+                       newImage->AllocateScalars( imageType ,1 );
+#endif
+
                        int iWidth;
                        for (iWidth=0;iWidth<width;iWidth++)
                        {
index 0cb5eea303d3985e2d2e5ec43c587b0de07d91b0..76af319eed93e38ad28984905625250d0e3d5413 100644 (file)
@@ -145,7 +145,14 @@ void creaVtkPlaneWidget::Process()
 {    
     if ((GetActive()==true) && (GetRenderer()!=NULL))
     { 
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _vPlaneWidget->SetInput( GetImage() );
+#else
+       _vPlaneWidget->SetInputData( GetImage() );
+#endif
+
        _vPlaneWidget->SetInteractor( GetRenderer()->GetRenderWindow()->GetInteractor() );
        _vPlaneWidget->NormalToXAxisOn();
        _vPlaneWidget->NormalToZAxisOn();
index 51685afb696fcdfeda105521262d2f2cfc910009..45ae170df5442f1e03fee6c8b94a1ea882e49378 100644 (file)
@@ -108,27 +108,53 @@ void creaVtkStreamLine::Process()
 
                        if (GetTypeForm()==0) 
                        {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                                _tubefilter->SetInput( _polydata );
+#else
+                               _tubefilter->SetInputData( _polydata );
+#endif
                                _tubefilter->SetRadius( GetScaleFactor() );     
                                _tubefilter->SetNumberOfSides(12);
                                _tubefilter->SetVaryRadiusToVaryRadiusOff();            
                                _tubefilter->Modified();
                                _tubefilter->Update();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                                _streamMapper2->SetInput( _tubefilter->GetOutput() );
+#else
+                               _streamMapper2->SetInputData( _tubefilter->GetOutput() );
+#endif
                        } 
                        if (GetTypeForm()==1) 
                        {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                                _ribbonfilter->SetInput( _polydata );
+#else
+                               _ribbonfilter->SetInputData( _polydata );
+#endif
                                _ribbonfilter->SetWidth( GetScaleFactor() );    
                                _ribbonfilter->SetWidthFactor( GetScaleFactor()*10 );
                                _ribbonfilter->GlobalWarningDisplayOff ();  //EED this is to avoid the "BEVEL WARNING"
                                _ribbonfilter->Modified();
                                _ribbonfilter->Update();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                                _streamMapper2->SetInput( _ribbonfilter->GetOutput() );
+#else
+                               _streamMapper2->SetInputData( _ribbonfilter->GetOutput() );
+#endif
                        }                       
                        if (GetTypeForm()==2) 
                        {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                                _streamMapper2->SetInput( _polydata );
+#else
+                               _streamMapper2->SetInputData( _polydata );
+#endif
                        }                       
 //EED                  _streamMapper2->SetLookupTable(vGreenToRedLut);
 
index 95fd4c5f3b11bc5946e311e8f7b9544ffd847ab7..5a33531815003d7f82a9b5a4cde4ab15f9d3dbe7 100644 (file)
@@ -126,7 +126,12 @@ void creaVtkStreamLineScalarSeg::Process()
                }               
                _newvtkpolydata->GetPointData()->RemoveArray( _ScalarArrayName.c_str() );
                _newvtkpolydata->GetPointData()->AddArray( newScalarArray );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _newvtkpolydata->Update();
+#else
+               _newvtkpolydata->Modified();
+#endif
 
        _StreamLinesOut = _newvtkpolydata;
 
index 5c44dc08ebda54800f702db3ad9af882608882aa..a88192f27d580e3b9e8f5882570927d9b11a2c03 100644 (file)
@@ -87,9 +87,15 @@ printf("EED creaVtkStreamTracer::Process() A\n");
 //                     _source->SetCenter( c );
 //                     _source->Update();
                        
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        _streamer->SetInput( _dataobject );
 //EED1 _streamer->SetSource( _source->GetOutput() );
                        _streamer->SetSource( _sourcePoints );
+#else
+                       _streamer->SetInputData( _dataobject );
+                       _streamer->SetSourceData( _sourcePoints );
+#endif
                        _streamer->SetIntegratorTypeToRungeKutta45();
                        _streamer->SetMaximumPropagation(500);
 //EED          _streamer->SetMaximumPropagationUnitToTimeUnit();
index 3609557e26bdedac789b54c255b7c1809a0a4daf..2226f2d4b0b7bd0922235ba6d26579155ab6a06f 100644 (file)
@@ -82,7 +82,13 @@ vtkImageData * creaVtkUnMosaicVectorVtkImageData::unMosaic(vtkImageData *imageIn
    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();
+#else
+   imageIn->Modified();
+#endif
      
    unsigned int div = (unsigned int)ceil(sqrt( (double)numberOfImagesInMosaic ) );
    outputdims[0] = inputdims[0] / div;
@@ -93,13 +99,20 @@ vtkImageData * creaVtkUnMosaicVectorVtkImageData::unMosaic(vtkImageData *imageIn
     vtkImageOut = vtkImageData::New();
     vtkImageOut->SetDimensions( outputdims );
     vtkImageOut->SetExtent(0,outputdims[0]-1,0,outputdims[1]-1,0,outputdims[2]-1);
+    
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
     vtkImageOut->SetWholeExtent(0,outputdims[0]-1,0,outputdims[1]-1,0,outputdims[2]-1);
     vtkImageOut->SetNumberOfScalarComponents(1);
 //vtkImageOut->SetSpacing( blabla );
     vtkImageOut->SetScalarType( VTK_UNSIGNED_SHORT );
     vtkImageOut->AllocateScalars();
     vtkImageOut->Update();
-    
+#else
+    vtkImageOut->AllocateScalars(VTK_UNSIGNED_SHORT,1);
+#endif
+
+
     unsigned short *output =(unsigned short *)(vtkImageOut->GetScalarPointer());
 
     unsigned short *dest = output;
index 9659847a6e891736482aefa7694dd33ca949641b..640b09910925217c9027a3aad96b7487c23957ff 100644 (file)
@@ -186,21 +186,37 @@ void cutImageSegmentation::Process()
                m_Image->SetOrigin(origin);
 
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                extrude->SetInput(m_Mesh1);
+#else
+               extrude->SetInputData(m_Mesh1);
+#endif
                extrude->SetScaleFactor(1);
                extrude->SetExtrusionTypeToNormalExtrusion();
                extrude->SetVector(0,0,1);
                extrude->Update();
 
                dataToStencil->SetTolerance(0);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                dataToStencil->SetInput(extrude->GetOutput());
+#else
+               dataToStencil->SetInputData(extrude->GetOutput());
+#endif
                dataToStencil->SetOutputOrigin(origin);
                dataToStencil->SetOutputSpacing(spacing);
                dataToStencil->SetOutputWholeExtent(m_Image->GetExtent());
                dataToStencil->Update();
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                imageStencil->SetInput(m_Image);
                imageStencil->SetStencil(dataToStencil->GetOutput());
+#else
+               imageStencil->SetInputData(m_Image);
+               imageStencil->SetStencilData(dataToStencil->GetOutput());
+#endif
                imageStencil->ReverseStencilOff();
                imageStencil->SetBackgroundValue(-200);
                imageStencil->Update();
index 5ccc9d82bd16859a90b455d19e90c27a6b4b6dbd..1299cdc5c71bcac9de708eca6220b89fb085fb1f 100644 (file)
@@ -38,15 +38,20 @@ vtkImageDataStrucPoints::~vtkImageDataStrucPoints()
 }
 void vtkImageDataStrucPoints::joinComponents(vtkImageData* imageX, vtkImageData* imageY, vtkImageData* imageZ)
 {
+       int ext[6];
        imageY->Modified();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        imageY->Update();
-       int ext[6];
        imageY->GetWholeExtent(ext);
+#else
+       imageY->GetExtent(ext);
+#endif
        int dim[3];
-  double spc[3];;
-  dim[0]=ext[1]-ext[0]+1;
-  dim[1]=ext[3]-ext[2]+1;
-  dim[2]=ext[5]-ext[4]+1;      
+       double spc[3];
+       dim[0]=ext[1]-ext[0]+1;
+       dim[1]=ext[3]-ext[2]+1;
+       dim[2]=ext[5]-ext[4]+1; 
        std::cout<<"dim "<< dim[0] <<" "<< dim[1] <<" "<< dim[2] <<std::endl;
 
        imageY->GetSpacing(spc);
@@ -85,12 +90,26 @@ printf("EED  vtkImageDataStrucPoints::joinComponents  sizeimage %d\n", sizeimage
        _structuredPoints = vtkStructuredPoints::New();
        _structuredPoints->SetDimensions(dim[0], dim[1], dim[2]);
        _structuredPoints->SetSpacing(spc);
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _structuredPoints->SetScalarTypeToDouble();
        _structuredPoints->SetNumberOfScalarComponents(3);
+#else
+       vtkInformation* info=_structuredPoints->GetInformation();
+       vtkDataObject::SetPointDataActiveScalarInfo(info, VTK_DOUBLE, 3);
+
+#endif
+
        _structuredPoints->GetPointData()->SetVectors(array);
        _structuredPoints->GetPointData()->SetNumberOfTuples(sizeimage);
        _structuredPoints->Modified();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _structuredPoints->Update();
+#else
+  //...
+#endif
 
 /*
        _structuredPoints->Print(cout);
index f26bf2e0969562a4a322bfecf21c5ad22e03cfbb..9d522cb3ba4e88b5be2dbc62d8ef2ff7646bdf5c 100644 (file)
@@ -69,7 +69,13 @@ void vtkStreamLineCreateColorInfo::Run()
        double                  vx,vy,vz,mag;
        double                  colorDirX,colorDirY,colorDirZ;
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _StreamLinesIn->Update();
+#else
+  //...
+#endif
+
        vtkCharArray    *mask                           = vtkCharArray::New();
        vtkDoubleArray  *magnitud                       = vtkDoubleArray::New();
        vtkDoubleArray  *velocity                       = vtkDoubleArray::New();
index 7d451f31699b4025d4f1f5f652de92e14f49bd51..f1a73ec92eb835c40dd4697fd3f583a5ce349131 100644 (file)
@@ -52,30 +52,50 @@ vtkTensorsVisu::~vtkTensorsVisu()
 //------------------------------------------------------------------------
 void vtkTensorsVisu::Process()
 {
-printf("EED vtkTensorsVisu::Process Start\n");
-
   if (_active==true)
   {
        if(GetTypeForm()==2)                                                            // source superquadratic
        {
                superquadratic->SetThetaResolution(20);
                superquadratic->SetPhiResolution(20);
+#if VTK_MAJOR_VERSION <= 5
                tg->SetSource(superquadratic->GetOutput());
+#else
+               tg->SetSourceData(superquadratic->GetOutput());
+#endif
        } else if(GetTypeForm()==1) {                                   // source sphere
+#if VTK_MAJOR_VERSION <= 5
                tg->SetSource(ss->GetOutput());
+#else
+               tg->SetSourceData(ss->GetOutput());
+#endif
        } else {                                                                                                // source cube
+#if VTK_MAJOR_VERSION <= 5
                tg->SetSource(cs->GetOutput());         
+#else
+               tg->SetSourceData(cs->GetOutput());     
+#endif
        }
 
+#if VTK_MAJOR_VERSION <= 5
        tg->SetInput( GetDataObject() );
+#else
+       tg->SetInputData( GetDataObject() );
+#endif
        //              tg->ScalingOn();
        //              tg->SetScaling(25);
        tg->SetScaleFactor( GetScaleFactor() );
 
        //The normals are needed to generate the right colors and if
        // not used some of the glyphs are black.
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        pdn->SetInput(tg->GetOutput());
        _pdm->SetInput( pdn->GetOutput() );
+#else
+       pdn->SetInputData(tg->GetOutput());
+       _pdm->SetInputData( pdn->GetOutput() );
+#endif
        _actor->SetMapper( _pdm );
    _actor->GetProperty()->SetOpacity( GetOpacity() );
 
@@ -83,8 +103,15 @@ printf("EED vtkTensorsVisu::Process Start\n");
 //   tg->SetColorModeToScalars();
    tg->Update();
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        pd = tg->GetOutput();
        pd->Update();
+#else
+       tg->Update();
+       pd = tg->GetOutput();
+#endif
+
        pod = pd->GetPointData();
        pod->Update();
 
@@ -121,7 +148,7 @@ printf("EED vtkTensorsVisu::Process Start\n");
                int      idEigen;
                for (iNumPts=0;iNumPts<numPnts;iNumPts++)
                {
-                       normalValue     = tensorsArray->GetTuple9(iNumPts);
+                       normalValue = tensorsArray->GetTuple9(iNumPts);
          sumEigenvalue1 = sqrt (normalValue[0]*normalValue[0] + normalValue[1]*normalValue[1] + normalValue[2]*normalValue[2]);
          sumEigenvalue2 = sqrt (normalValue[3]*normalValue[3] + normalValue[4]*normalValue[4] + normalValue[5]*normalValue[5]);
          sumEigenvalue3 = sqrt (normalValue[6]*normalValue[6] + normalValue[7]*normalValue[7] + normalValue[8]*normalValue[8]);
@@ -193,6 +220,5 @@ printf("EED vtkTensorsVisu::Process Start\n");
 
     VisibilityActor(); 
 
-printf("EED vtkTensorsVisu::Process End.\n");
 }
 
index af6fe0d9c8eff54dbf9aaacf7a77d4112f494876..92c3df40293c4ceac6970204482ccad1dbd404da 100644 (file)
@@ -51,16 +51,27 @@ vtkVectorsVisu::~vtkVectorsVisu()
 //------------------------------------------------------------------------------
 void vtkVectorsVisu::Process()
 {
-printf("EED vtkVectorsVisu::Process()  start\n");
      if(_active==true)
      {
+#if VTK_MAJOR_VERSION <= 5
          _vtkglyph->SetInput( GetDataObject() );  
+#else
+         _vtkglyph->SetInputData( GetDataObject() );  
+#endif
 
                        if(GetTypeForm()==1)                                                            // source Arrow
                        {
+#if VTK_MAJOR_VERSION <= 5
                 _vtkglyph->SetSource( _vtkarrowsource->GetOutput() );
+#else
+                _vtkglyph->SetSourceData( _vtkarrowsource->GetOutput() );
+#endif
                        } else {                                                                                                // source Line
+#if VTK_MAJOR_VERSION <= 5
                                _vtkglyph->SetSource( _vtklinesource->GetOutput() );    
+#else
+                               _vtkglyph->SetSourceData( _vtklinesource->GetOutput() );        
+#endif
                        }
 
          _vtkglyph->SetScaleModeToScaleByVector();
@@ -68,7 +79,11 @@ printf("EED vtkVectorsVisu::Process()  start\n");
          _vtkglyph->SetScaleFactor( GetScaleFactor() );
          _vtkglyph->Update();
 
+#if VTK_MAJOR_VERSION <= 5
          _pdm->SetInput( _vtkglyph->GetOutput());
+#else
+         _pdm->SetInputData( _vtkglyph->GetOutput());
+#endif
 
 vtkPointData   *data   = _vtkglyph->GetOutput()->GetPointData();
 //printf("EED -------------------------------------------\n");
@@ -126,7 +141,6 @@ for (i=0;i<sizeDa;i++)
     }// if _active
 
     VisibilityActor(); 
-printf("EED vtkVectorsVisu::Process()  end\n");
 }