]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourCrownWidget.cxx
#3109 creaMaracasVisu Bug New Normal - branch vtk7itk4 compilation with vtk7
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / Contour / ContourCrownWidget.cxx
index 3ab512b57199daf2bb825554452667a0bbcdfce9..010ec0c533cb3ca0b73357c5e14b7ed894ab3a2d 100644 (file)
@@ -122,11 +122,22 @@ void wxMaracasCoutourTool::Init(wxVtkBaseView *wxvtkbaseview, vtkImageData* imag
        table->SetRampToLinear();
        table->Build();
        
-       vtkImageMapToColors  *mapperImage = vtkImageMapToColors::New();
+       vtkImageMapToColors  *mapperImage       = vtkImageMapToColors::New();
+       vtkImageActor *actorImage                       = vtkImageActor::New();
+
        mapperImage->SetLookupTable(table);
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        mapperImage->SetInput( imagedataMaskResult );
-       vtkImageActor *actorImage       = vtkImageActor::New();
        actorImage->SetInput( mapperImage->GetOutput() );
+#else
+       mapperImage->SetInputData( imagedataMaskResult );
+       actorImage->SetInputData( mapperImage->GetOutput() );
+#endif
+
+
        actorImage->SetOpacity(1);
        
        wxvtkbaseview->GetRenderer()->AddActor(actorImage);     
@@ -488,17 +499,31 @@ void wxMaracasCoutourTool::InitVtkImagesResult()
 
          imagedataValueResult = vtkImageData::New();
 //       imagedataValueResult->SetScalarType(scalartype);
-         imagedataValueResult->SetScalarTypeToUnsignedShort();
          imagedataValueResult->SetSpacing(spc);
          imagedataValueResult->SetDimensions( newDim );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+         imagedataValueResult->SetScalarTypeToUnsignedShort();
          imagedataValueResult->AllocateScalars();
+#else
+         imagedataValueResult->AllocateScalars(VTK_UNSIGNED_SHORT,1);
+#endif
+
 
          imagedataMaskResult  = vtkImageData::New();
 //       imagedataMaskResult->SetScalarType(scalartype);
-         imagedataMaskResult->SetScalarTypeToUnsignedShort();
          imagedataMaskResult->SetSpacing(spc);
          imagedataMaskResult->SetDimensions( newDim );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+         imagedataMaskResult->SetScalarTypeToUnsignedShort();
          imagedataMaskResult->AllocateScalars();
+#else
+         imagedataMaskResult->AllocateScalars(VTK_UNSIGNED_SHORT,1);
+#endif
+
 
   }