Skip to content

Commit 17d6c6f

Browse files
hjmjohnsondzenanz
authored andcommitted
COMP: Fix VTK 8.2.0 build issues.
1 parent 06166b7 commit 17d6c6f

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

src/Bridge/VtkGlue/VTKImageToITKImage/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ project(VTKImageToITKImage)
55
find_package(ITK REQUIRED)
66
include(${ITK_USE_FILE})
77

8+
find_package(VTK REQUIRED)
9+
include(${VTK_USE_FILE})
810

911
add_executable(VTKImageToITKImage Code.cxx)
10-
target_link_libraries(VTKImageToITKImage ${ITK_LIBRARIES})
12+
target_link_libraries(VTKImageToITKImage ${ITK_LIBRARIES} ${VTK_LIBRARIES})
1113

1214
install(TARGETS VTKImageToITKImage
1315
DESTINATION bin/ITKExamples/Bridge/VtkGlue

src/Core/Common/InPlaceFilterOfImage/Code.cxx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,22 @@
1515
* limitations under the License.
1616
*
1717
*=========================================================================*/
18-
/*
1918
#include "itkImage.h"
2019
#include "itkImageFileReader.h"
2120
#include "itkBinaryThresholdImageFilter.h"
2221

2322
#include <itkImageToVTKImageFilter.h>
2423

25-
#include "vtkImageViewer.h"
26-
#include "vtkRenderWindowInteractor.h"
24+
#include "vtkVersion.h"
25+
2726
#include "vtkSmartPointer.h"
28-
#include "vtkImageActor.h"
29-
#include "vtkInteractorStyleImage.h"
27+
#include "vtkRenderWindow.h"
3028
#include "vtkRenderer.h"
29+
#include "vtkInteractorStyleImage.h"
30+
#include "vtkRenderWindowInteractor.h"
31+
#include "vtkImageActor.h"
32+
#include "vtkImageMapper3D.h"
33+
#include "vtkImageViewer.h"
3134

3235
using ImageType = itk::Image< unsigned char, 2 >;
3336

@@ -60,7 +63,12 @@ int main(int argc, char *argv[])
6063

6164
vtkSmartPointer<vtkImageActor> actor =
6265
vtkSmartPointer<vtkImageActor>::New();
66+
#if VTK_MAJOR_VERSION <= 5
6367
actor->SetInput(connector->GetOutput());
68+
#else
69+
connector->Update();
70+
actor->GetMapper()->SetInputData(connector->GetOutput());
71+
#endif
6472

6573
// There will be one render window
6674
vtkSmartPointer<vtkRenderWindow> renderWindow =

src/Core/Mesh/ConvertMeshToUnstructeredGrid/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ project(ConvertMeshToUnstructeredGrid)
55
find_package(ITK REQUIRED)
66
include(${ITK_USE_FILE})
77

8+
find_package(VTK REQUIRED)
9+
include(${VTK_USE_FILE})
810

911
add_executable(ConvertMeshToUnstructeredGrid Code.cxx)
10-
target_link_libraries(ConvertMeshToUnstructeredGrid ${ITK_LIBRARIES})
12+
target_link_libraries(ConvertMeshToUnstructeredGrid ${ITK_LIBRARIES} ${VTK_LIBRARIES})
1113

1214
install(TARGETS ConvertMeshToUnstructeredGrid
1315
DESTINATION bin/ITKExamples/Core/Mesh

0 commit comments

Comments
 (0)