X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FvtkPlane2DView.cxx;h=3c715ae038aa09f20939c2d2a435b0050d3a7a76;hb=255f774ce4100c0b84e6b5efa5c64d0db77f8a61;hp=1016dd464e1fdb5b03c5483b99418953634a35ba;hpb=c9cb75801571d66b1b28de180a1138a7cb884690;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx index 1016dd4..3c715ae 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx @@ -226,17 +226,41 @@ void vtkPlane2DView::Extract_One_PlaneVTK() { vtkImageData *imagedata = GetVtkmprbasedata()->GetImageData(); SetPSource(_sizeIma); + +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 _3Dslices -> SetInput( ( vtkDataSet* )_pSource->GetOutput( ) ); _3Dslices -> SetSource( imagedata ); +#else + _3Dslices -> SetInputData( ( vtkDataSet* )_pSource->GetOutput( ) ); + _3Dslices -> SetSourceData( imagedata ); +#endif + _3Dslices -> Update( ); _stPoints -> GetPointData( )->SetScalars( _3Dslices->GetOutput()->GetPointData()->GetScalars() ); _stPoints -> SetDimensions( _sizeIma, _sizeIma, 1 ); + +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 _stPoints -> SetScalarType( imagedata->GetScalarType() ); _stPoints -> SetScalarTypeToShort(); _stPoints -> Update(); // _change -> SetInput( _stPoints ); // _change -> Update(); //important _imageViewer2XYZ->GetVtkImageViewer2()->SetInput ( _stPoints ); +#else +printf("EED Warning! vtkPlane2DView::Extract_One_PlaneVTK VTK 5->7 ???? SetScalarTypeToShort \n"); +printf("EED Warning! vtkPlane2DView::Extract_One_PlaneVTK VTK 5->7 ???? SetScalarTypeToShort \n"); +printf("EED Warning! vtkPlane2DView::Extract_One_PlaneVTK VTK 5->7 ???? SetScalarTypeToShort \n"); +printf("EED Warning! vtkPlane2DView::Extract_One_PlaneVTK VTK 5->7 ???? SetScalarTypeToShort \n"); +printf("EED Warning! vtkPlane2DView::Extract_One_PlaneVTK VTK 5->7 ???? SetScalarTypeToShort \n"); + vtkInformation* info=_stPoints->GetInformation(); + vtkDataObject::SetPointDataActiveScalarInfo(info, VTK_SHORT, 1); + _imageViewer2XYZ->GetVtkImageViewer2()->SetInputData( _stPoints ); + +#endif + + // _imageViewer2XYZ->GetVtkImageViewer2()->SetInput ( _change->GetOutput() ); // vtkImageActor *imageActor = _imageViewer2XYZ->GetVtkImageViewer2()->GetImageActor(); } @@ -276,8 +300,14 @@ void vtkPlane2DView::Extract_MIP_PlaneVTK( /*double heightDefinition*/ ) for ( iWidth=0 ; iWidth SetInput( ( vtkDataSet* )_pSource->GetOutput( ) ); slice -> SetSource( imagedata ); +#else + slice -> SetInputData( ( vtkDataSet* )_pSource->GetOutput( ) ); + slice -> SetSourceData( imagedata ); +#endif slice -> Update( ); slicesLST.push_back( slice ); _pSource->Push( sp ); @@ -287,11 +317,17 @@ void vtkPlane2DView::Extract_MIP_PlaneVTK( /*double heightDefinition*/ ) _imageResult = vtkImageData::New(); _imageResult -> SetDimensions(_sizeIma,_sizeIma,1); _imageResult -> SetSpacing(1,1,1); - _imageResult -> SetScalarType( imagedata->GetScalarType() ); _imageResult -> SetExtent(0,_sizeIma-1,0,_sizeIma-1,0,0); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 + _imageResult -> SetScalarType( imagedata->GetScalarType() ); _imageResult -> SetWholeExtent(0,_sizeIma-1,0,_sizeIma-1,0,0); _imageResult -> AllocateScalars(); _imageResult -> Update(); +#else + _imageResult -> AllocateScalars(imagedata->GetScalarType(),1); +#endif + } unsigned short *pTemp; unsigned short *pResult; @@ -324,7 +360,12 @@ void vtkPlane2DView::Extract_MIP_PlaneVTK( /*double heightDefinition*/ ) slicesLST[iWidth]->Delete(); } _imageResult->Modified(); - _imageViewer2XYZ->GetVtkImageViewer2()->SetInput ( _imageResult ); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 + _imageViewer2XYZ->GetVtkImageViewer2()->SetInput( _imageResult ); +#else + _imageViewer2XYZ->GetVtkImageViewer2()->SetInputData( _imageResult ); +#endif } //------------------------------------------------------------------- @@ -341,7 +382,7 @@ void vtkPlane2DView::Configure( ) _stPoints = vtkStructuredPoints::New( ); _change = vtkImageChangeInformation::New(); - wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor(); + crea::wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor(); ExtractPlane(); // SetActive(false); _imageViewer2XYZ -> GetVtkImageViewer2() -> SetupInteractor ( iren ); @@ -404,7 +445,12 @@ void vtkPlane2DView::HorizontalLine() lines->Delete(); //do not delete lines ?? _lineActor = vtkActor::New(); _lineMapper = vtkPolyDataMapper::New(); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 _lineMapper->SetInput(_pd); +#else + _lineMapper->SetInputData(_pd); +#endif _lineMapper->ImmediateModeRenderingOn(); _lineActor->SetMapper(_lineMapper); _lineActor->GetProperty()->BackfaceCullingOn();