X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FwxVtkMPR3DView.cxx;h=a55a101ec4311dce7ce0ebf69a6ae8d80efe0425;hb=94a6229aed777e2270a361e3d1721a14daa50d25;hp=1d9ff304bb673656854c3d459791030b54ee880f;hpb=3283472f764535492122c3b2ade020a749c1bd2a;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx index 1d9ff30..a55a101 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx @@ -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 );