CREA_DEFINE( USE_VTK )
CREA_DEFINE( _USE_VTK_ )
- SET(VTK_LIBRARIES
- vtkCommon # Mandatory
- vtkFiltering # vtkImageData
- vtkRendering # vtkProp3D
- vtkWidgets # vtkImagePlaneWidget
- vtkIO # vtkMetaImageReader/Writer
- vtkImaging # filters such as vtkImageAnisotropicDiffusion3D
- vtkGraphics # vtkContourFilter, sources
- vtkVolumeRendering # Mappers
- vtkGenericFiltering
- vtkHybrid
-# vtkInfovis
-# vtkViews
+
+##EED 2017-01-01 Migration VTK7
+IF("${VTK_MAJOR_VERSION}" LESS 6)
+ SET(VTK_LIBRARIES
+ vtkCommon # Mandatory
+ vtkFiltering # vtkImageData
+ vtkRendering # vtkProp3D
+ vtkWidgets # vtkImagePlaneWidget
+ vtkIO # vtkMetaImageReader/Writer
+ vtkImaging # filters such as vtkImageAnisotropicDiffusion3D
+ vtkGraphics # vtkContourFilter, sources
+ vtkVolumeRendering # Mappers
+ vtkGenericFiltering
+ vtkHybrid
+# vtkInfovis
+# vtkViews
)
- IF(NOT USE_ITK)
- SET(VTK_LIBRARIES ${VTK_LIBRARIES} vtkIO)
- ENDIF(NOT USE_ITK)
- MARK_AS_ADVANCED(VTK_DIR)
+ IF(NOT USE_ITK)
+ SET(VTK_LIBRARIES ${VTK_LIBRARIES} vtkIO)
+ ENDIF(NOT USE_ITK)
+
+ENDIF("${VTK_MAJOR_VERSION}" LESS 6)
+
+
+##EED 2017-01-01 Migration VTK7
+IF("${VTK_MAJOR_VERSION}" GREATER 5)
+ SET(VTK_LIBRARIES
+ vtkCommonCore
+ vtkCommonExecutionModel
+ vtkIOImage
+ vtkRenderingCore
+ vtkInteractionStyle
+ vtkImagingCore
+ vtkRenderingFreeType
+ vtkRenderingOpenGL2
+ vtkIOLegacy
+ vtkInteractionImage
+ )
+ENDIF("${VTK_MAJOR_VERSION}" GREATER 5)
+
+
+ MARK_AS_ADVANCED(VTK_DIR)
ELSE(VTK_FOUND)
message(FATAL_ERROR "VTK_DIR not found")
ENDIF(VTK_FOUND)
// Shouldn't we pass NumberOfScalarComponents to deal with RGB, RGBA images as well? // JPR
- image->SetNumberOfScalarComponents(1);
int vtktype = vtkTypeTraits<T>::VTKTypeID();
- image->SetScalarType(vtktype);
image->SetDimensions(nx, ny ,nz);
image->SetSpacing(1, 1, 1);
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5)
+ image->SetNumberOfScalarComponents(1);
+ image->SetScalarType(vtktype);
image->AllocateScalars();
+#endif
+#if (VTK_MAJOR_VERSION >= 6)
+ image->AllocateScalars(vtktype,1);
+#endif
+
+
vtkDataArray* array = 0;
switch (vtktype)
{
// An outline is shown for context.
vtkOutlineFilter* outline = vtkOutlineFilter::New();
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5)
outline->SetInput(I);
+#endif
+#if (VTK_MAJOR_VERSION >= 6)
+ outline->SetInputData(I);
+#endif
vtkPolyDataMapper* outlineMapper = vtkPolyDataMapper::New();
outlineMapper->SetInputConnection(outline->GetOutputPort());
// The 3 image plane widgets are used to probe the dataset.
vtkImagePlaneWidget* planeWidgetX = vtkImagePlaneWidget::New();
planeWidgetX->DisplayTextOn();
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5)
planeWidgetX->SetInput(I);
+#endif
+#if (VTK_MAJOR_VERSION >= 6)
+ planeWidgetX->SetInputData(I);
+#endif
+
planeWidgetX->SetPlaneOrientationToXAxes();
planeWidgetX->SetSlicePosition((xMax+xMin)/2.);
planeWidgetX->SetPicker(picker);
vtkImagePlaneWidget* planeWidgetY = vtkImagePlaneWidget::New();
planeWidgetY->DisplayTextOn();
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5)
planeWidgetY->SetInput(I);
+#endif
+#if (VTK_MAJOR_VERSION >= 6)
+ planeWidgetY->SetInputData(I);
+#endif
+
planeWidgetY->SetPlaneOrientationToYAxes();
planeWidgetY->SetSlicePosition((yMax+yMin)/2.);
planeWidgetY->SetPicker(picker);