From: Eduardo DAVILA Date: Wed, 8 Aug 2018 12:32:44 +0000 (+0200) Subject: 3219 creaMaracasVisu Feature New Normal - vtk8itk4wx3-mingw64 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=a906c7009b5c3c2ef5263f4d84ba13be7d4549ff;p=creaMaracasVisu.git 3219 creaMaracasVisu Feature New Normal - vtk8itk4wx3-mingw64 --- diff --git a/bbtk/src/bbcreaMaracasVisuSetPosition.cxx b/bbtk/src/bbcreaMaracasVisuSetPosition.cxx index 8b23084..a76bc22 100644 --- a/bbtk/src/bbcreaMaracasVisuSetPosition.cxx +++ b/bbtk/src/bbcreaMaracasVisuSetPosition.cxx @@ -41,7 +41,14 @@ void SetPosition::Process() vtkmprbasedata->SetY( bbGetInputPoint()[1] ); vtkmprbasedata->SetZ( bbGetInputPoint()[2] ); wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121); // Refres +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 bbGetInputwxVtkBaseView()->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessEvent( newevent ); +#else + bbGetInputwxVtkBaseView()->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessWindowEvent( newevent ); +#endif + + } // if bbGetInputPosition } // bbGetInputwxVtkBaseView } diff --git a/bbtk/src/bbmaracasvisuImageActor.cxx b/bbtk/src/bbmaracasvisuImageActor.cxx index 34c0fd7..fb2df56 100644 --- a/bbtk/src/bbmaracasvisuImageActor.cxx +++ b/bbtk/src/bbmaracasvisuImageActor.cxx @@ -53,7 +53,12 @@ printf("EED ImageActor::Process Start\n"); { if (bbGetInputLookupTable()==NULL) { +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 imageactor->SetInput( img ); +#else + imageactor->SetInputData( img ); +#endif } else { /* vtkLookupTable *table = vtkLookupTable::New(); @@ -116,9 +121,17 @@ vtkLookupTable *table = vtkLookupTable::New(); // imageshiftscale->SetOutputScalarTypeToUnsignedChar(); // color->SetInput( imageshiftscale->GetOutput() ); + + +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 color->SetInput( img ); color->Update(); imageactor->GetMapper()->SetInput( color->GetOutput() ); +#else + color->SetInputData( img ); + imageactor->GetMapper()->SetInputData( color->GetOutput() ); +#endif imageactor->GetProperty()->SetInterpolationTypeToNearest(); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx index 9dc9133..da3d19b 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx @@ -575,21 +575,18 @@ void ContourExtractData::InitVtkImagesResult() imagedataValueResult->Delete(); } imagedataValueResult = vtkImageData::New(); - -//EED 2017-12-18 - imagedataValueResult->SetScalarType(scalartype); - //imagedataValueResult->SetScalarTypeToUnsignedShort(); - - imagedataValueResult->SetSpacing(spc); imagedataValueResult->SetDimensions( newDim ); //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 - imagedataValueResult->SetScalarTypeToUnsignedShort(); + +//EED 2017-12-18 + imagedataValueResult->SetScalarType(scalartype); + //imagedataValueResult->SetScalarTypeToUnsignedShort(); imagedataValueResult->AllocateScalars(); #else - imagedataValueResult->AllocateScalars(VTK_UNSIGNED_SHORT,1); + imagedataValueResult->AllocateScalars(scalartype,1); #endif @@ -599,20 +596,18 @@ void ContourExtractData::InitVtkImagesResult() } imagedataMaskResult = vtkImageData::New(); -//EED 2017-12-18 -// imagedataMaskResult->SetScalarType(scalartype); -// imagedataMaskResult->SetScalarTypeToUnsignedShort(); - imagedataMaskResult->SetScalarTypeToUnsignedChar(); imagedataMaskResult->SetSpacing(spc); imagedataMaskResult->SetDimensions( newDim ); //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 - imagedataMaskResult->SetScalarTypeToUnsignedShort(); + //EED 2017-12-18 + //imagedataMaskResult->SetScalarTypeToUnsignedShort(); + imagedataMaskResult->SetScalarTypeToUnsignedChar(); imagedataMaskResult->AllocateScalars(); #else - imagedataMaskResult->AllocateScalars(VTK_UNSIGNED_SHORT,1); + imagedataMaskResult->AllocateScalars(VTK_UNSIGNED_CHAR,1); #endif } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp index c1ac0be..e2ea023 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp @@ -49,7 +49,9 @@ FillFilter::~FillFilter() //--------------------------------------------------------------------------- void FillFilter::SetImages(vtkImageData *image,vtkImageData *image2) // virtual { - baseFilterManualPaint::SetImages(image,image2); + + + baseFilterManualPaint::SetImages(image,image2); if ((_maxX!=_maxXback) || (_maxY!=_maxYback) || (_maxZ!=_maxZback)) { @@ -61,31 +63,20 @@ 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 _ptrAuxImageFill = (unsigned char *)_auxImageFill->GetScalarPointer(); memset(_ptrAuxImageFill, 0, (_maxX+1) * (_maxY+1) * (_maxZ+1) ); } - - _auxImageFill = vtkImageData::New(); - _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 - _maxXback=_maxX; _maxYback=_maxY; - _maxYback=_maxZ; + _maxYback=_maxZ; } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx index 5c4e0c7..cb1dc1e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx @@ -143,15 +143,16 @@ void vtkMPR3DDataViewer::SetImage() { //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 - _saggitalColors->SetInput( _vtkmprbasedata->GetImageData() ); - _axialColors->SetInput( _vtkmprbasedata->GetImageData() ); - _coronalColors->SetInput( _vtkmprbasedata->GetImageData() ); + _saggitalColors ->SetInput( _vtkmprbasedata->GetImageData() ); + _axialColors ->SetInput( _vtkmprbasedata->GetImageData() ); + _coronalColors ->SetInput( _vtkmprbasedata->GetImageData() ); + _outlineData ->SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() ); #else - _saggitalColors->SetInputData( _vtkmprbasedata->GetImageData() ); - _axialColors->SetInputData( _vtkmprbasedata->GetImageData() ); - _coronalColors->SetInputData( _vtkmprbasedata->GetImageData() ); + _saggitalColors ->SetInputData( _vtkmprbasedata->GetImageData() ); + _axialColors ->SetInputData( _vtkmprbasedata->GetImageData() ); + _coronalColors ->SetInputData( _vtkmprbasedata->GetImageData() ); + _outlineData ->SetInputData((vtkDataSet *) _vtkmprbasedata->GetImageData() ); #endif - _outlineData -> SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() ); } //------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx index b705076..dc7c52e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx @@ -152,15 +152,17 @@ printf("//EED wxVtk2DBaseView::ResetView %d %d %d %d %d %d \n",x1,x2,y1,y void wxVtk2DBaseView::SetImageToVtkViewer(vtkImageData *imageData) { int ext[6]; - imageData->Update(); - imageData->GetWholeExtent(ext); if (_imageViewer2XYZ!=NULL) { //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 + imageData->Update(); + imageData->GetWholeExtent(ext); _imageViewer2XYZ->SetExtentDimension( ext[0],ext[1],ext[2],ext[3],ext[4],ext[5] ); _imageViewer2XYZ->GetVtkImageViewer2()->SetInput( imageData ); #else + imageData->GetExtent(ext); + _imageViewer2XYZ->SetExtentDimension( ext[0],ext[1],ext[2],ext[3],ext[4],ext[5] ); _imageViewer2XYZ->GetVtkImageViewer2()->SetInputData( imageData ); #endif } // if _imageViewer2XYZ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx index 253a683..d475e93 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx @@ -764,8 +764,13 @@ void wxVtkMPR3DViewCntrlPanel::OnInterpolate(wxCommandEvent& event) { _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetInterpolate( _ckBoxInterpolate->GetValue() ); _wxvtkmpr3Dview->Refresh(); - wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh + wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); +#else + _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); +#endif } //------------------------------------------------------------------- @@ -788,7 +793,12 @@ void wxVtkMPR3DViewCntrlPanel::OnOpacityAxis(wxCommandEvent& event) _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetOpacityAxis( _opacityAxis->GetValue()/100.0 ); _wxvtkmpr3Dview->Refresh(); wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); +#else + _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); +#endif }