]> Creatis software - creaMaracasVisu.git/commitdiff
#3109 creaMaracasVisu Bug New Normal - branch vtk7itk4 compilation with vtk7
authorEduardo DAVILA <davila@localhost.localdomain>
Thu, 27 Jul 2017 13:51:06 +0000 (15:51 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Thu, 27 Jul 2017 13:51:06 +0000 (15:51 +0200)
14 files changed:
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewPoint.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/baseFilterManualPaint.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pHistogram.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewCntrlPanel.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxWidgetMesure2D_Plane.cxx
lib/maracasVisuLib/src/kernel/PlaneDirectionManagerData.cxx
lib/maracasVisuLib/src/kernel/marDicomBase.cpp
lib/maracasVisuLib/src/kernel/volume.cxx

index 198b7b1a5e55678bcff87ec2eeac3b5cbce448b6..e1588bf4f3cae10683c1d5523ac6f3e95a2bcee5 100644 (file)
@@ -315,7 +315,15 @@ void manualViewBaseContour::ConstructVTKObjects()
     _bboxMapper                        =       vtkPolyDataMapper::New();
     _bboxMapper->ScalarVisibilityOff( );
 
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _bboxMapper->SetInput(_pd);
+#else
+       _bboxMapper->SetInputData(_pd);
+#endif
+
+
        _bboxMapper->ImmediateModeRenderingOn();
        _contourVtkActor->SetMapper(_bboxMapper);
        _contourVtkActor->GetProperty()->BackfaceCullingOff();
index 5a8625a28c989d0fa69267dcd2216e028b9aac4b..ca17755e25093e7b65bd8f89bbfcdcaadd2ae73f 100644 (file)
@@ -157,7 +157,16 @@ vtkActor* manualViewPoint::CreateVtkPointActor()
        _pointVtkActor  =       vtkActor::New();
     _bboxMapper                =       vtkPolyDataMapper::New();
 
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _bboxMapper->SetInput(_pd);
+#else
+       _bboxMapper->SetInputData(_pd);
+#endif
+
+
 //     _bboxMapper->ImmediateModeRenderingOn();
        _pointVtkActor->SetMapper(_bboxMapper);
 //     _pointVtkActor->GetProperty()->BackfaceCullingOn();
index 1139e035b0bf9c263c438db85202891587b1225f..4156a3d54492d2c5cb7394dd916002e6892a752f 100644 (file)
@@ -54,9 +54,18 @@ void FillFilter::SetImages(vtkImageData *image,vtkImageData *image2) // virtual
        _auxImageFill->SetDimensions(_maxX + 1, _maxY + 1, _maxZ + 1);
        _auxImageFill->SetOrigin(0, 0, 0);
        _auxImageFill->SetExtent(0, _maxX, 0, _maxY, 0, _maxZ);
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _auxImageFill->SetWholeExtent(0, _maxX, 0, _maxY, 0, _maxZ);
        _auxImageFill->SetScalarTypeToUnsignedChar();
        _auxImageFill->AllocateScalars();
+#else
+       _auxImageFill->AllocateScalars(VTK_UNSIGNED_CHAR,1);
+#endif
+
+
 }
 
 //---------------------------------------------------------------------------
index 0a9f995c57616ad9292aaf3c9852d7f44b9fdd37..0ca0de29abf6a7a94ab9f68fbfb2d25b696f9970 100644 (file)
@@ -91,7 +91,12 @@ void baseFilterManualPaint::SetImages(vtkImageData *image, vtkImageData *image2)
        _image2 = image2;
 
        int ext[6];
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _image->GetWholeExtent(ext);
+#else
+       _image->GetExtent(ext);
+#endif
        _minX = 0;
        _minY = 0;
        _minZ = 0;
@@ -99,7 +104,14 @@ void baseFilterManualPaint::SetImages(vtkImageData *image, vtkImageData *image2)
        if (_image2!=NULL)
        {
                int extB[6];
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _image2->GetWholeExtent(extB);
+#else
+               _image2->GetExtent(extB);
+#endif
+
                _maxX = std::min( ext[1]-ext[0] , extB[1]-extB[0] );
                _maxY = std::min( ext[3]-ext[2] , extB[3]-extB[2] );
                _maxZ = std::min( ext[5]-ext[4] , extB[5]-extB[4] );
index c14e9511348f57ac1bf39256258777ebdfbaf2d9..95dc7a6f121e2068e3852cfbe2a63147e9e4cffe 100644 (file)
@@ -135,9 +135,16 @@ void pHistogram::initializePoints(int xDimension)
        //setting image data of the points
        points->SetDimensions(xDimension,1,1);
 //EED  points->SetScalarTypeToUnsignedShort();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        points->SetScalarTypeToDouble();
        points->AllocateScalars();
        points->Update();
+#else
+       points->AllocateScalars(VTK_DOUBLE,1);
+#endif
+
 }
 
 /*
@@ -163,12 +170,12 @@ printf("EED pHistogram::setPoints colums:%d\n", (int)(resulttable->GetNumberOfCo
        */
 
        char*                           dataImagePointerC               = (char*)imageData->GetScalarPointer(0,0,0);
-       unsigned char*  dataImagePointerUC      = (unsigned char*)imageData->GetScalarPointer(0,0,0);
+       unsigned char*          dataImagePointerUC              = (unsigned char*)imageData->GetScalarPointer(0,0,0);
        short*                          dataImagePointerS               = (short*)imageData->GetScalarPointer(0,0,0);
-       unsigned short*         dataImagePointerUS      = (unsigned short*)imageData->GetScalarPointer(0,0,0);
+       unsigned short*         dataImagePointerUS              = (unsigned short*)imageData->GetScalarPointer(0,0,0);
        float*                          dataImagePointerF               = (float*)imageData->GetScalarPointer(0,0,0);
-       double*                                 dataImagePointerD               = (double*)imageData->GetScalarPointer(0,0,0);
-       double*                                 dataHistogramPointer    = (double*)points->GetScalarPointer(0,0,0);
+       double*                         dataImagePointerD               = (double*)imageData->GetScalarPointer(0,0,0);
+       double*                         dataHistogramPointer    = (double*)points->GetScalarPointer(0,0,0);
        
        /*
         Range of greys
index bd26d120d364e66401ac592ac30059cd5db585ce..029f1ef6a1e6f302eb4c445dca87e72f054c54a1 100644 (file)
@@ -108,10 +108,15 @@ void wxVtk2DBaseView::ResetView()
        wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
        vtkImageData *imageData = GetVtkBaseData()->GetImageData();
        if(imageData){
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                imageData->UpdateInformation();
                imageData->SetUpdateExtent( imageData->GetWholeExtent());
                imageData->Update();
                _imageViewer2XYZ->GetVtkImageViewer2()->SetInput(imageData );
+#else
+               _imageViewer2XYZ->GetVtkImageViewer2()->SetInputData(imageData );
+#endif
                imageData->GetSpacing (spx,spy,spz);
                imageData->GetExtent (x1,x2,y1,y2,z1,z2);
        }
@@ -151,7 +156,12 @@ void wxVtk2DBaseView::SetImageToVtkViewer(vtkImageData *imageData)
 {
        if (_imageViewer2XYZ!=NULL)
        {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _imageViewer2XYZ->GetVtkImageViewer2()->SetInput( imageData );
+#else
+               _imageViewer2XYZ->GetVtkImageViewer2()->SetInputData( imageData );
+#endif
        } // if _imageViewer2XYZ
 }
 
@@ -193,9 +203,16 @@ void wxVtk2DBaseView::Configure(bool okimage)
        vtkImageData *imageData = GetVtkBaseData()->GetMarImageData()->GetImageData();
        if (imageData!=NULL)
        {
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                imageData->UpdateInformation();
                imageData->SetUpdateExtent( imageData->GetWholeExtent());
                imageData->Update();
+#else
+               //...
+#endif
+
                if (okimage==true){
                        imageData->GetSpacing (spx,spy,spz);
                        imageData->GetExtent (x1,x2,y1,y2,z1,z2);
index 84c3c609dd20fdad9e612e648d49aed7ff9dd065..6172e1deccc61e81d1d13a96305a8d62eddedb55 100644 (file)
@@ -179,8 +179,12 @@ void wxVtkClipping3DView::Configure()
        vtkStripper *stripper=_vtkclipping3Ddataviewer->GetTissueStripper(0);
        vtkPolyData *polydata= stripper->GetOutput();
 
-
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _boxWidgetS1->SetInput( polydata );
+#else
+       _boxWidgetS1->SetInputData( polydata );
+#endif
 
 //EED 2016-08-19       
        //_boxWidgetS1->PlaceWidget();
@@ -218,7 +222,14 @@ void wxVtkClipping3DView::Configure()
        _boxWidgetVolume = vtkBoxWidget::New();
        _boxWidgetVolume->SetInteractor( _wxvtk3Dbaseview->GetWxVTKRenderWindowInteractor() );
        _boxWidgetVolume->SetPlaceFactor(1.25);
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _boxWidgetVolume->SetInput( this->GetVtkClipping3DDataViewer()->GetVtkMPRBaseData()->GetImageData() );
+#else
+       _boxWidgetVolume->SetInputData( this->GetVtkClipping3DDataViewer()->GetVtkMPRBaseData()->GetImageData() );
+#endif
+
        _boxWidgetVolume->PlaceWidget();
        _boxWidgetVolume->AddObserver( vtkCommand::InteractionEvent, _vtkclipping3Ddataviewer->GetObserverV() );
        _boxWidgetVolume->HandlesOn ();
index da8764c2c9ff569dec6f1d5c16073b0b682015bd..0a706c364ecb25966afaedc4976d07206fba15e5 100644 (file)
@@ -496,16 +496,32 @@ void wxVtkClipping3DViewCntrlPanel::OnBtnCreateFileSTL(wxCommandEvent& event)
         vtkTriangleFilter *filtro = vtkTriangleFilter::New();
 
 
-               filtro->SetInput( this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetTissueClipper(idTissue)->GetOutput() );
                vtkPolyDataConnectivityFilter *pdcf = vtkPolyDataConnectivityFilter::New();
-        pdcf->SetInput( filtro->GetOutput() );
         vtkClosePolyData *cpd = vtkClosePolyData::New();
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+               filtro->SetInput( this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetTissueClipper(idTissue)->GetOutput() );
+        pdcf->SetInput( filtro->GetOutput() );
         cpd->SetInput( pdcf->GetOutput() );
+#else
+               filtro->SetInputData( this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetTissueClipper(idTissue)->GetOutput() );
+        pdcf->SetInputData( filtro->GetOutput() );
+        cpd->SetInputData( pdcf->GetOutput() );
+#endif
 
                // 1.2 se escribe a disco el archivo stl de la superficie interna
         cpd->Update();
         vtkSTLWriter *writer = vtkSTLWriter::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
         writer->SetInput( cpd->GetOutput() );
+#else
+        writer->SetInputData( cpd->GetOutput() );
+#endif
+
                filename =prefix;
         writer->SetFileName(filename.c_str());
         writer->SetFileTypeToASCII();
index 803bea180e9eed803882a9e249172eab98dd2b58..eae1fb6086b8a31aaa7a0a3599c3d1bdc3f10129 100644 (file)
@@ -115,7 +115,14 @@ void wxVtkMPR2DView::Configure()
                _ptsA->SetPoint(1,  1000        ,  1000 ,  1000 );
                _pdA = vtkPolyData::New();
                _lineAMapper = vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _lineAMapper->SetInput(_pdA);
+#else
+               _lineAMapper->SetInputData(_pdA);
+#endif
+
                _lineAMapper->ImmediateModeRenderingOn();
                _lineAActor->SetMapper(_lineAMapper);
        }
@@ -153,7 +160,14 @@ void wxVtkMPR2DView::Configure()
        _pdB->SetPoints( _ptsB );
        _pdB->SetLines( linesB );
        linesB->Delete();  //do not delete lines ??
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _lineBMapper->SetInput(_pdB);
+#else
+       _lineBMapper->SetInputData(_pdB);
+#endif
+
        _lineBMapper->ImmediateModeRenderingOn();
        if(_imageViewer2XYZ){
                _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineAActor );
index 1d9ff304bb673656854c3d459791030b54ee880f..a55a101ec4311dce7ce0ebf69a6ae8d80efe0425 100644 (file)
@@ -218,7 +218,12 @@ void wxVtkMPR3DView::Configure()
                if(_pointWidget==NULL){
                        _pointWidget = vtkPointWidget::New();
                }
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _pointWidget->SetInput( imageData );
+#else
+               _pointWidget->SetInputData( imageData );
+#endif
                _myCallback->SetVtkPointWidget(_pointWidget);
                _pointWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
                _pointWidget->AllOff();
@@ -230,7 +235,12 @@ void wxVtkMPR3DView::Configure()
                {
                        _planeWidget = vtkPlaneWidget::New();
                }
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _planeWidget->SetInput( imageData );
+#else
+               _planeWidget->SetInputData( imageData );
+#endif
 
                _myCallback->SetVtkPlaneWidget(_planeWidget);
 
@@ -251,11 +261,17 @@ void wxVtkMPR3DView::Configure()
                        _vtkplane = vtkPolyData::New();
 
                        _probe = vtkProbeFilter::New();
-                       _probe->SetInput(_vtkplane);
-
                        _contourMapper = vtkPolyDataMapper::New();
 
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+                       _probe->SetInput(_vtkplane);
                        _contourMapper->SetInput( _probe->GetPolyDataOutput() );
+#else
+                       _probe->SetInputData(_vtkplane);
+                       _contourMapper->SetInputData( _probe->GetPolyDataOutput() );
+#endif
 
                        _contourPlaneActor = vtkActor::New();
                        _contourPlaneActor->SetMapper(_contourMapper);
@@ -271,7 +287,13 @@ void wxVtkMPR3DView::Configure()
                }
 
                _planeWidget->GetPolyData(_vtkplane);
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _probe->SetSource( imageData );
+#else
+               _probe->SetSourceData( imageData );
+#endif
                _contourMapper->SetScalarRange( imageData->GetScalarRange() );
 
        ConfigureFreePlanes();
@@ -349,11 +371,21 @@ void wxVtkMPR3DView::SetImage()
 {
        vtkImageData *imageData                                 = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
        // Orthogonal planes B&W
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _planeWidgetX->SetInput( imageData );
        _planeWidgetY->SetInput( imageData );
        _planeWidgetZ->SetInput( imageData );
        // -- Plane widget
        _probe->SetSource( imageData );
+#else
+       _planeWidgetX->SetInputData( imageData );
+       _planeWidgetY->SetInputData( imageData );
+       _planeWidgetZ->SetInputData( imageData );
+       // -- Plane widget
+       _probe->SetSourceData( imageData );
+#endif
+
        _vtkmpr3Ddataviewer->SetImage();
 }
 
@@ -370,7 +402,13 @@ vtkImagePlaneWidget* wxVtkMPR3DView::GetPlaneWidget(unsigned char activationkey,
        double xSpacing = 0, ySpacing = 0, zSpacing = 0;
        if(image)
        {
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                planeWidget->SetInput( image );
+#else
+               planeWidget->SetInputData( image );
+#endif
                image->GetExtent(xMin, xMax, yMin, yMax, zMin, zMax);
                image->GetSpacing(xSpacing, ySpacing, zSpacing);
        }
@@ -555,7 +593,12 @@ void wxVtkMPR3DView::RefreshView()   // virtual
 
        if(_pointWidget)
        {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _pointWidget->SetInput( image );
+#else
+               _pointWidget->SetInputData( image );
+#endif
                _pointWidget->PlaceWidget();
 
                _pointWidget->SetPosition( x,y,z );
@@ -737,7 +780,12 @@ void wxVtkMPR3DView::TestLoic1()
        double spc[3];
        vtkimagedata->GetSpacing(spc);
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        vtkimagedata->Update();
+#else
+       // ..
+#endif
 
 
         double p[3], n[3];
@@ -757,20 +805,41 @@ void wxVtkMPR3DView::TestLoic1()
     pSource->Update( );
 
     vtkProbeFilter* slices = vtkProbeFilter::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
     slices->SetInput( ( vtkDataSet* )pSource->GetOutput( ) );
     slices->SetSource( vtkimagedata );
     slices->Update( );
     pSource->Delete( );
+#else
+    slices->SetInputData( ( vtkDataSet* )pSource->GetOutput( ) );
+    slices->SetSourceData( vtkimagedata );
+#endif
 
        vtkStructuredPoints   *stPoints = vtkStructuredPoints::New();
        stPoints -> GetPointData( )->SetScalars(  slices->GetOutput()->GetPointData()->GetScalars()  );
        stPoints -> SetDimensions( sizeIma, sizeIma, 1 );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        stPoints -> SetScalarType( vtkimagedata->GetScalarType() );
        stPoints -> SetScalarTypeToShort();
        stPoints -> Update();
+#else
+       vtkInformation* info=stPoints->GetInformation();
+       vtkDataObject::SetPointDataActiveScalarInfo(info, VTK_SHORT, 1);
+#endif
+
+
 
        vtkImageChangeInformation  *change = vtkImageChangeInformation ::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        change    -> SetInput( stPoints );
+#else
+       change    -> SetInputData( stPoints );
+#endif
        change    -> Update();    //important
 
        double _range[2];
@@ -794,7 +863,12 @@ void wxVtkMPR3DView::TestLoic1()
 
 
        vtkMetaImageWriter *writer = vtkMetaImageWriter::New( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        writer->SetInput( stPoints );
+#else
+       writer->SetInputData( stPoints );
+#endif
        writer->SetFileName( "C:/Users/Images/temp_EED/image.mhd" );
        writer->SetFileDimensionality( 2 );
        writer->Write( );
@@ -802,7 +876,14 @@ void wxVtkMPR3DView::TestLoic1()
 
 
        vtkDataSetMapper *_3DSliceMapper = vtkDataSetMapper::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _3DSliceMapper->SetInput(change->GetOutput( ) );
+#else
+       _3DSliceMapper->SetInputData(change->GetOutput( ) );
+#endif
+
        _3DSliceMapper->SetLookupTable( _bwlookup );
        _3DSliceMapper->SetScalarRange( _range );
        _3DSliceMapper->ImmediateModeRenderingOn( );
@@ -855,14 +936,24 @@ void wxVtkMPR3DView::TestLoic2()
 
         vtkCutter* sliceCutter = vtkCutter::New();
                vtkImageData *vtkimagedata =  this->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                 sliceCutter->SetInput( vtkimagedata );
+#else
+                sliceCutter->SetInputData( vtkimagedata );
+#endif
                 sliceCutter->SetCutFunction( slicePlane );
 
 //EED
 //        vtkLookupTable *lut = BuildHueWeightBaseMap();
 
         vtkPolyDataMapper *slice = vtkPolyDataMapper::New();
-                slice->SetInput( sliceCutter->GetOutput() );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+               slice->SetInput( sliceCutter->GetOutput() );
+#else
+               slice->SetInputData( sliceCutter->GetOutput() );
+#endif
         double range[2];
 // EED
 //                slice->Update();
@@ -876,7 +967,14 @@ void wxVtkMPR3DView::TestLoic2()
 //                sliceActor->SetMapper( slice );
 
         vtkPolyDataMapper *contourMapper = vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                 contourMapper->SetInput( sliceCutter->GetOutput() );
+#else
+                contourMapper->SetInputData( sliceCutter->GetOutput() );
+#endif
+
                 contourMapper->SetScalarRange( range );
   //              contourMapper->SetLookupTable( lut );
 
index 6ffd82d2dfe0c32f17d26bbc80aed4f29b2b86fe..54455923c47dc0c8860715b62ae408fb475bf99c 100644 (file)
@@ -226,7 +226,13 @@ void wxWidgetMesure2D_Plane::CircleLine()
        lines->Delete();  //do not delete lines ??
        _circle1Actor                                   =       vtkActor::New();
     _circle1Mapper                                     =       vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _circle1Mapper->SetInput(_pdCircle1);
+#else
+       _circle1Mapper->SetInputData(_pdCircle1);
+#endif
        _circle1Mapper->ImmediateModeRenderingOn();
        _circle1Actor->SetMapper(_circle1Mapper);
        _circle1Actor->GetProperty()->BackfaceCullingOn();
@@ -253,7 +259,12 @@ void wxWidgetMesure2D_Plane::CircleLine()
        lines->Delete();  //do not delete lines ??
        _circle2Actor                                   =       vtkActor::New();
     _circle2Mapper                                     =       vtkPolyDataMapper::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _circle2Mapper->SetInput(_pdCircle2);
+#else
+       _circle2Mapper->SetInputData(_pdCircle2);
+#endif
        _circle2Mapper->ImmediateModeRenderingOn();
        _circle2Actor->SetMapper(_circle2Mapper);
        _circle2Actor->GetProperty()->BackfaceCullingOn();
@@ -277,7 +288,14 @@ void wxWidgetMesure2D_Plane::CircleLine()
        lines->Delete();  //do not delete lines ??
        _lineRef1Actor                                  =       vtkActor::New();
     _lineRef1Mapper                                    =       vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _lineRef1Mapper->SetInput(_pdLineRef1);
+#else
+       _lineRef1Mapper->SetInputData(_pdLineRef1);
+#endif
+
        _lineRef1Mapper->ImmediateModeRenderingOn();
        _lineRef1Actor->SetMapper(_lineRef1Mapper);
        _lineRef1Actor->GetProperty()->BackfaceCullingOn();
@@ -301,7 +319,14 @@ void wxWidgetMesure2D_Plane::CircleLine()
        lines->Delete();  //do not delete lines ??
        _lineRef2Actor                                  =       vtkActor::New();
     _lineRef2Mapper                                    =       vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _lineRef2Mapper->SetInput(_pdLineRef2);
+#else
+       _lineRef2Mapper->SetInputData(_pdLineRef2);
+#endif
+
        _lineRef2Mapper->ImmediateModeRenderingOn();
        _lineRef2Actor->SetMapper(_lineRef2Mapper);
        _lineRef2Actor->GetProperty()->BackfaceCullingOn();
index 22e49152a171e8f3f0b5787e26d0f6c558a23898..a42b0e54d9cc528accad1a90cc0b5825722b1ba9 100644 (file)
@@ -34,33 +34,40 @@ PlaneDirectionManagerData::PlaneDirectionManagerData(int radio, double colour[3]
 :PlanesOperations(){   
        _vtkarrow               = vtkArrowSource::New();        
        _arrowMapper    = vtkPolyDataMapper::New();
-       _arrowActor     = vtkActor::New();
+       _arrowActor             = vtkActor::New();
 
        _vtkarrow->SetTipResolution(30);
        _vtkarrow->SetShaftResolution( 30  );   
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _arrowMapper->SetInput( _vtkarrow->GetOutput() );       
+#else
+       _arrowMapper->SetInputData( _vtkarrow->GetOutput() );   
+#endif
+
        _arrowActor->SetMapper(_arrowMapper);   
 
-       _radio = radio;
-       _colour = colour;
-       _opacity = opacity;
-
-       p0 = new double[3];
-       p0[0] = 0;
-       p0[1] = 0;
-       p0[2] = 0;
-       p1 = new double[3];
-       p1[0] = 0;
-       p1[1] = 0;
-       p1[2] = 0;
-       p2 = new double[3];
-       p2[0] = 1;
-       p2[1] = 1;
-       p2[2] = 1;
-       _dir = new double[3];
-       _dir[0] = 0;
-       _dir[1] = 0;
-       _dir[2] = 0;
+       _radio                  = radio;
+       _colour                 = colour;
+       _opacity                = opacity;
+
+       p0                              = new double[3];
+       p0[0]                   = 0;
+       p0[1]                   = 0;
+       p0[2]                   = 0;
+       p1                              = new double[3];
+       p1[0]                   = 0;
+       p1[1]                   = 0;
+       p1[2]                   = 0;
+       p2                              = new double[3];
+       p2[0]                   = 1;
+       p2[1]                   = 1;
+       p2[2]                   = 1;
+       _dir                    = new double[3];
+       _dir[0]                 = 0;
+       _dir[1]                 = 0;
+       _dir[2]                 = 0;
 }
 
 
index 6d0bb372da6c95acabef4af8243043f7677457c5..9d376c0b00b0324fbff611012020a881e856459d 100644 (file)
@@ -633,7 +633,12 @@ void marRAW2Files::loadActualSerie(wxGauge* gauge )
 void marRAW2Files::FlipY(vtkImageData *imagedata)
 {
        vtkImageData *vtkimagedata = imagedata;
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        vtkimagedata->Update();
+#else
+  //...
+#endif
        int dim[3];
        vtkimagedata->GetDimensions(dim);
        unsigned short tmp;
@@ -662,7 +667,12 @@ void marRAW2Files::FlipY(vtkImageData *imagedata)
                                }
                        }
                }
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
    vtkimagedata->Update();
+#else
+   vtkimagedata->Modified();
+#endif
 
 }
 // -------------------------------------------------------------------------
@@ -675,7 +685,13 @@ void marRAW2Files::saveVolume( std::string directory, std::string name, vtkImage
 
                // Crop
        vtkExtractVOI *crop = vtkExtractVOI::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        crop->SetInput( imagedata );
+#else
+       crop->SetInputData( imagedata );
+#endif
        crop->SetVOI( voi );
        crop->Update();
 
@@ -688,7 +704,12 @@ void marRAW2Files::saveVolume( std::string directory, std::string name, vtkImage
 
 
        vtkImageChangeInformation* change = vtkImageChangeInformation::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        change->SetInput( crop->GetOutput() );
+#else
+       change->SetInputData( crop->GetOutput() );
+#endif
 
 
 //     change->SetExtentTranslation( -ext[0], -ext[2], -ext[4] );
@@ -705,7 +726,14 @@ void marRAW2Files::saveVolume( std::string directory, std::string name, vtkImage
    std::string nameMW           = filename+".mhd";
 
        vtkMetaImageWriter *writer = vtkMetaImageWriter::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        writer->SetInput( change->GetOutput() );
+#else
+       writer->SetInputData( change->GetOutput() );
+#endif
+
        writer->SetFileName( nameMW.c_str() );
        writer->SetFileDimensionality( 3 );
        writer->Write( );
index c70a31bb05ed673ff088e259bb90363b80792412..9bdafc34c38ec2b639d2de885b3466a2c0a93f28 100644 (file)
@@ -724,14 +724,14 @@ void kVolume::buildIndex( )
        
 #ifdef KGFO_USE_VTK
        
-    vtkCharArraycarray;
-    vtkDoubleArraydarray;
-    vtkFloatArrayfarray;
-    vtkIntArrayiarray;
-    vtkShortArraysarray;
-    vtkUnsignedCharArrayucarray;
-    vtkUnsignedIntArrayuiarray;
-    vtkUnsignedShortArrayusarray;
+    vtkCharArray                       *carray;
+    vtkDoubleArray                     *darray;
+    vtkFloatArray                      *farray;
+    vtkIntArray                                *iarray;
+    vtkShortArray                      *sarray;
+    vtkUnsignedCharArray       *ucarray;
+    vtkUnsignedIntArray                *uiarray;
+    vtkUnsignedShortArray      *usarray;
        
     size = _dims[ CX ] * _dims[ CY ] * _dims[ CZ ];
 
@@ -741,82 +741,279 @@ void kVolume::buildIndex( )
        _vtk->SetDimensions( _dims[ CX ], _dims[ CY ], _dims[ CZ ] );
        _vtk->SetSpacing( _sizes[ CX ], _sizes[ CY ], _sizes[ CZ ] );
 
+       if (_type==CHAR)
+       {
+           carray = vtkCharArray::New( );
+           carray->SetArray( ( char* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+           carray->SetNumberOfComponents( 1 );
+           _vtk->SetScalarType( VTK_CHAR );
+#else
+               vtkInformation* infoC=_vtk->GetInformation();
+               vtkDataObject::SetPointDataActiveScalarInfo(infoC, VTK_CHAR, 1);
+#endif
+           _vtk->GetPointData( )->SetScalars( carray );
+           carray->Delete( );
+       }
+
+       if (_type==UCHAR)
+       {
+           ucarray = vtkUnsignedCharArray::New( );
+           ucarray->SetArray( ( uint8_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+           ucarray->SetNumberOfComponents( 1 );
+           _vtk->SetScalarType( VTK_UNSIGNED_CHAR );
+#else
+               vtkInformation* infoUC=_vtk->GetInformation();
+               vtkDataObject::SetPointDataActiveScalarInfo(infoUC, VTK_UNSIGNED_CHAR, 1);
+#endif
+           _vtk->GetPointData( )->SetScalars( ucarray );
+           ucarray->Delete( );
+       }
+
+
+
+
+
+       if (_type==SHORT)
+       {
+           sarray = vtkShortArray::New( );
+           sarray->SetArray( ( int16_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+           sarray->SetNumberOfComponents( 1 );
+           _vtk->SetScalarType( VTK_SHORT );
+#else
+               vtkInformation* infoS=_vtk->GetInformation();
+               vtkDataObject::SetPointDataActiveScalarInfo(infoS, VTK_SHORT, 1);
+#endif
+           _vtk->GetPointData( )->SetScalars( sarray );
+           sarray->Delete( );
+}
+
+       if (_type==INT)
+       {
+           iarray = vtkIntArray::New( );
+           iarray->SetArray( ( int32_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+           iarray->SetNumberOfComponents( 1 );
+           _vtk->SetScalarType( VTK_INT );
+#else
+               vtkInformation* infoI=_vtk->GetInformation();
+               vtkDataObject::SetPointDataActiveScalarInfo(infoI, VTK_INT, 1);
+#endif
+           _vtk->GetPointData( )->SetScalars( iarray );
+           iarray->Delete( );
+       }
+
+
+       if (_type==USHORT)
+       {
+           usarray = vtkUnsignedShortArray::New( );
+           usarray->SetArray( ( uint16_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+           usarray->SetNumberOfComponents( 1 );
+           _vtk->SetScalarType( VTK_UNSIGNED_SHORT );
+#else
+               vtkInformation* infoUS=_vtk->GetInformation();
+               vtkDataObject::SetPointDataActiveScalarInfo(infoUS, VTK_UNSIGNED_SHORT, 1);
+#endif
+           _vtk->GetPointData( )->SetScalars( usarray );
+           usarray->Delete( );
+       }
+
+
+       if (_type==UINT)
+       {
+           uiarray = vtkUnsignedIntArray::New( );
+           uiarray->SetArray( ( uint32_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+           uiarray->SetNumberOfComponents( 1 );
+           _vtk->SetScalarType( VTK_UNSIGNED_INT );
+#else
+               vtkInformation* infoUI=_vtk->GetInformation();
+               vtkDataObject::SetPointDataActiveScalarInfo(infoUI, VTK_UNSIGNED_INT, 1);
+#endif
+           _vtk->GetPointData( )->SetScalars( uiarray );
+           uiarray->Delete( );
+       }
+
+
+       if (_type==FLOAT)
+       {
+           farray = vtkFloatArray::New( );
+           farray->SetArray( ( float* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+           farray->SetNumberOfComponents( 1 );
+           _vtk->SetScalarType( VTK_FLOAT );
+#else
+               vtkInformation* infoF=_vtk->GetInformation();
+               vtkDataObject::SetPointDataActiveScalarInfo(infoF, VTK_FLOAT, 1);
+#endif
+           _vtk->GetPointData( )->SetScalars( farray );
+           farray->Delete( );
+       }
+
+                 
+       if (_type==DOUBLE)
+       {
+           darray = vtkDoubleArray::New( );
+           darray->SetArray( ( double* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+           darray->SetNumberOfComponents( 1 );
+           _vtk->SetScalarType( VTK_DOUBLE );
+#else
+               vtkInformation* infoD=_vtk->GetInformation();
+               vtkDataObject::SetPointDataActiveScalarInfo(infoD, VTK_DOUBLE, 1);
+#endif
+
+
+           _vtk->GetPointData( )->SetScalars( darray );
+           darray->Delete( );
+       }
+
+
+
+
+
+
+/*
        switch( _type ) {
 
        case CHAR:
            carray = vtkCharArray::New( );
-           carray->SetNumberOfComponents( 1 );
            carray->SetArray( ( char* )( _raw ), size, 1 );
+
+//EED 2017-01-01 Migration VTK7
+//#if VTK_MAJOR_VERSION <= 5
+           carray->SetNumberOfComponents( 1 );
            _vtk->SetScalarType( VTK_CHAR );
+#else
+               vtkInformation* infoC=_vtk->GetInformation();
+               vtkDataObject::SetPointDataActiveScalarInfo(infoC, VTK_CHAR, 1);
+#endif
+
            _vtk->GetPointData( )->SetScalars( carray );
            carray->Delete( );
            break;
 
        case UCHAR:
            ucarray = vtkUnsignedCharArray::New( );
-           ucarray->SetNumberOfComponents( 1 );
            ucarray->SetArray( ( uint8_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+           ucarray->SetNumberOfComponents( 1 );
            _vtk->SetScalarType( VTK_UNSIGNED_CHAR );
+#else
+               vtkInformation* infoUC=_vtk->GetInformation();
+               vtkDataObject::SetPointDataActiveScalarInfo(infoUC, VTK_UNSIGNED_CHAR, 1);
+#endif
            _vtk->GetPointData( )->SetScalars( ucarray );
            ucarray->Delete( );
            break;
 
        case SHORT:
            sarray = vtkShortArray::New( );
-           sarray->SetNumberOfComponents( 1 );
            sarray->SetArray( ( int16_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+           sarray->SetNumberOfComponents( 1 );
            _vtk->SetScalarType( VTK_SHORT );
+#else
+               vtkInformation* infoS=_vtk->GetInformation();
+               vtkDataObject::SetPointDataActiveScalarInfo(infoS, VTK_SHORT, 1);
+#endif
            _vtk->GetPointData( )->SetScalars( sarray );
            sarray->Delete( );
            break;
 
        case INT:
            iarray = vtkIntArray::New( );
-           iarray->SetNumberOfComponents( 1 );
            iarray->SetArray( ( int32_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+           iarray->SetNumberOfComponents( 1 );
            _vtk->SetScalarType( VTK_INT );
+#else
+               vtkInformation* infoI=_vtk->GetInformation();
+               vtkDataObject::SetPointDataActiveScalarInfo(infoI, VTK_INT, 1);
+#endif
            _vtk->GetPointData( )->SetScalars( iarray );
            iarray->Delete( );
            break;
 
        case USHORT:
            usarray = vtkUnsignedShortArray::New( );
-           usarray->SetNumberOfComponents( 1 );
            usarray->SetArray( ( uint16_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+           usarray->SetNumberOfComponents( 1 );
            _vtk->SetScalarType( VTK_UNSIGNED_SHORT );
+#else
+               vtkInformation* infoUS=_vtk->GetInformation();
+               vtkDataObject::SetPointDataActiveScalarInfo(infoUS, VTK_UNSIGNED_SHORT, 1);
+#endif
            _vtk->GetPointData( )->SetScalars( usarray );
            usarray->Delete( );
            break;
 
        case UINT:
            uiarray = vtkUnsignedIntArray::New( );
-           uiarray->SetNumberOfComponents( 1 );
            uiarray->SetArray( ( uint32_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+           uiarray->SetNumberOfComponents( 1 );
            _vtk->SetScalarType( VTK_UNSIGNED_INT );
+#else
+               vtkInformation* infoUI=_vtk->GetInformation();
+               vtkDataObject::SetPointDataActiveScalarInfo(infoUI, VTK_UNSIGNED_INT, 1);
+#endif
            _vtk->GetPointData( )->SetScalars( uiarray );
            uiarray->Delete( );
            break;
 
        case FLOAT:
            farray = vtkFloatArray::New( );
-           farray->SetNumberOfComponents( 1 );
            farray->SetArray( ( float* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+           farray->SetNumberOfComponents( 1 );
            _vtk->SetScalarType( VTK_FLOAT );
+#else
+               vtkInformation* infoF=_vtk->GetInformation();
+               vtkDataObject::SetPointDataActiveScalarInfo(infoF, VTK_FLOAT, 1);
+#endif
            _vtk->GetPointData( )->SetScalars( farray );
            farray->Delete( );
            break;
                  
        case DOUBLE:
            darray = vtkDoubleArray::New( );
-           darray->SetNumberOfComponents( 1 );
            darray->SetArray( ( double* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+           darray->SetNumberOfComponents( 1 );
            _vtk->SetScalarType( VTK_DOUBLE );
+#else
+               vtkInformation* infoD=_vtk->GetInformation();
+               vtkDataObject::SetPointDataActiveScalarInfo(infoD, VTK_DOUBLE, 1);
+#endif
+
+
            _vtk->GetPointData( )->SetScalars( darray );
            darray->Delete( );
            break;
                  
        } // fswitch
-         
+*/  
+
     } // fi
 
 #endif // KGFO_USE_VTK