]> Creatis software - creaMaracasVisu.git/commitdiff
3219 creaMaracasVisu Feature New Normal - vtk8itk4wx3-mingw64
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 8 Aug 2018 12:32:44 +0000 (14:32 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 8 Aug 2018 12:32:44 +0000 (14:32 +0200)
bbtk/src/bbcreaMaracasVisuSetPosition.cxx
bbtk/src/bbmaracasvisuImageActor.cxx
lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx

index 8b23084c1cf2beb7f53e58f73d596bdb90dbe297..a76bc22807c4255409f07493d6696d325e6b7ec6 100644 (file)
@@ -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
 }
index 34c0fd7754dc182e1b025dd1fdf521540ec9812f..fb2df56c67176eedda5687e2f11db4be6c6d8965 100644 (file)
@@ -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();
                        }
 
index 9dc9133a28248d8363998ca4f976543857d43b13..da3d19b816e7aab56e211799800c3660d91ba27c 100644 (file)
@@ -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
 
 }
index c1ac0be4a34e87cf4ff9be9940b921a9a507cada..e2ea0232c6d32dee6a2ab282706ce8d8da9b5f2c 100644 (file)
@@ -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;        
 }
 
 
index 5c4e0c7f98622ae20d7411600b68a06ce5e05848..cb1dc1e54e6b971f4456fed694c69f6fe4cc45e0 100644 (file)
@@ -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() );
 }
 
 //-------------------------------------------------------------------
index b705076c09f201f7006ae2b111b2d886b0dd6ad6..dc7c52e7268c06804b39c549675c2968955453ed 100644 (file)
@@ -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
index 253a6837fa1802b849ab19a624d45619a4ee70c6..d475e93b5c5044552c2841341e68f61c9cc70757 100644 (file)
@@ -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 
 }