Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: VTK Superbuild Update #193

Merged
merged 5 commits into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Superbuild/External-VTK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Get and build vtk

if(NOT VTK_TAG)
set(VTK_TAG "v8.2.0")
set(VTK_TAG "v9.0.1")
endif()

set(PYTHON_EXECUTABLE "${ITKPYTHON_EXECUTABLE}")
Expand Down
13 changes: 8 additions & 5 deletions src/Bridge/VtkGlue/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@ add_example(ConvertAnitkImageTovtkImageData)
add_example(ConvertAnRGBitkImageTovtkImageData)
add_example(ConvertvtkImageDataToAnitkImage)
add_example(ConvertRGBvtkImageDataToAnitkImage)
add_example(VisualizeEvolvingDense2DLevelSetAsElevationMap)
add_example(VisualizeEvolvingDense2DLevelSetZeroSet)

if(ENABLE_QUICKVIEW)

add_example(VTKImageToITKImage)
compare_to_baseline(EXAMPLE_NAME VTKImageToITKImage
BASELINE_PREFIX OutputBaseline
)
#TODO: Save output ITK image and then use it to compare to baseline
#compare_to_baseline(EXAMPLE_NAME VTKImageToITKImage
# BASELINE_PREFIX OutputBaseline
# )

if(ITK_VERSION_MAJOR LESS 5)
add_example(VisualizeEvolvingDense2DLevelSetAsElevationMap)
add_example(VisualizeEvolvingDense2DLevelSetZeroSet)
add_example(VisualizeStaticDense2DLevelSetAsElevationMap)
add_example(VisualizeStaticDense2DLevelSetZeroSet)
add_example(VisualizeStaticWhitaker2DLevelSetLayers)
add_example(VisualizeStaticShi2DLevelSetLayers)
add_example(VisualizeStaticMalcolm2DLevelSetLayers)
endif()

endif()
17 changes: 14 additions & 3 deletions src/Bridge/VtkGlue/ConvertvtkImageDataToAnitkImage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,27 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})

# Since we use vtkImageMagnitude
find_package(VTK REQUIRED COMPONENTS vtkImagingMath)
include(${VTK_USE_FILE})

find_package(VTK REQUIRED
COMPONENTS
ImagingMath
)
if(VTK_VERSION VERSION_LESS "8.90.0")
include(${VTK_USE_FILE})
endif()

add_executable(ConvertvtkImageDataToAnitkImage Code.cxx)
target_link_libraries(ConvertvtkImageDataToAnitkImage
${ITK_LIBRARIES}
${VTK_LIBRARIES}
)

if(NOT VTK_VERSION VERSION_LESS "8.90.0")
vtk_module_autoinit(
TARGETS ConvertvtkImageDataToAnitkImage
MODULES ${VTK_LIBRARIES}
)
endif()

install(TARGETS ConvertvtkImageDataToAnitkImage
DESTINATION bin/ITKExamples/Bridge/VtkGlue
COMPONENT Runtime
Expand Down
21 changes: 18 additions & 3 deletions src/Bridge/VtkGlue/VTKImageToITKImage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,27 @@ project(VTKImageToITKImage)
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})

find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
find_package(VTK REQUIRED
COMPONENTS
vtkImagingColor
vtkIOImage
vtkRenderingCore
vtkRenderingGL2PSOpenGL2
)
if(VTK_VERSION VERSION_LESS "8.90.0")
include(${VTK_USE_FILE})
endif()

add_executable(VTKImageToITKImage Code.cxx)
target_link_libraries(VTKImageToITKImage ${ITK_LIBRARIES} ${VTK_LIBRARIES})

if(NOT VTK_VERSION VERSION_LESS "8.90.0")
vtk_module_autoinit(
TARGETS VTKImageToITKImage
MODULES ${VTK_LIBRARIES}
)
endif()

install(TARGETS VTKImageToITKImage
DESTINATION bin/ITKExamples/Bridge/VtkGlue
COMPONENT Runtime
Expand All @@ -24,5 +39,5 @@ install(FILES Code.cxx CMakeLists.txt

enable_testing()
add_test(NAME VTKImageToITKImageTest
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/VTKImageToITKImage)
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/VTKImageToITKImage Gourds.png)

19 changes: 11 additions & 8 deletions src/Bridge/VtkGlue/VTKImageToITKImage/Documentation.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
VTK Image To ITK Image
======================
.. warning::
**Fix Problem**
Contains problems not fixed from original wiki.
.. index::
single: VTKImageToImageFilter

Expand All @@ -14,11 +11,17 @@ Convert a VTK image to an ITK image.

Results
-------
.. note::
**Help Wanted**
Implementation of Results for sphinx examples containing this message.
Reconfiguration of CMakeList.txt may be necessary.
`Write An Example <https://itk.org/ITKExamples/Documentation/Contribute/WriteANewExample.html`>
.. figure:: Gourds.png
:scale: 50%
:alt: Input image.

Input Image

.. figure:: VTKImageToITKImageQuickview.png
:scale: 50%
:alt: QuickView output.

Output In QuickView

Code
----
Expand Down
1 change: 1 addition & 0 deletions src/Bridge/VtkGlue/VTKImageToITKImage/Gourds.png.sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
859fd5a9de82ac8bbdf81c1c75548ce340c36c46396c8f63bbe709fe572af54df3bf69e18ece04e84977db3fee7aafc50ea6d51926cec1891661fb45a1762907
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1b114c209ad010f6710b8c63a2a3ef66dc237d5efc7eb12dcb6a2105535f1c9ee568bd0bd646acd8da78c6468c257e857956a6d5518546461a796452e4c6c689
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,25 @@ project( VisualizeStaticDense2DLevelSetAsElevationMap )
find_package( ITK REQUIRED )
include( ${ITK_USE_FILE} )

find_package( VTK REQUIRED )
include( ${VTK_USE_FILE} )
find_package( VTK REQUIRED
COMPONENTS
vtkInteractionImage
vtkRenderingCore
vtkRenderingGL2PSOpenGL2
)
if( VTK_VERSION VERSION_LESS "8.90.0" )
include( ${VTK_USE_FILE} )
endif()

add_executable( VisualizeStaticDense2DLevelSetAsElevationMap Code.cxx )
target_link_libraries( VisualizeStaticDense2DLevelSetAsElevationMap ${ITK_LIBRARIES} ${VTK_LIBRARIES})

add_executable( VisualizeStaticDense2DLevelSetAsElevationMap Code.cxx)
target_link_libraries( VisualizeStaticDense2DLevelSetAsElevationMap ${ITK_LIBRARIES} )
if( NOT VTK_VERSION VERSION_LESS "8.90.0" )
vtk_module_autoinit(
TARGETS VisualizeStaticDense2DLevelSetAsElevationMap
MODULES ${VTK_LIBRARIES}
)
endif()

install( TARGETS VisualizeStaticDense2DLevelSetAsElevationMap
DESTINATION bin/ITKExamples/Bridge/VtkGlue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,24 @@ project( VisualizeStaticDense2DLevelSetZeroSet )
find_package( ITK REQUIRED )
include( ${ITK_USE_FILE} )

find_package( VTK REQUIRED )
include( ${VTK_USE_FILE} )
find_package( VTK REQUIRED
COMPONENTS
vtkRenderingCore
vtkRenderingGL2PSOpenGL2
)
if( VTK_VERSION VERSION_LESS "8.90.0" )
include( ${VTK_USE_FILE} )
endif()

add_executable( VisualizeStaticDense2DLevelSetZeroSet Code.cxx )
target_link_libraries( VisualizeStaticDense2DLevelSetZeroSet ${ITK_LIBRARIES} ${VTK_LIBRARIES} )

add_executable( VisualizeStaticDense2DLevelSetZeroSet Code.cxx)
target_link_libraries( VisualizeStaticDense2DLevelSetZeroSet ${ITK_LIBRARIES} )
if( NOT VTK_VERSION VERSION_LESS "8.90.0" )
vtk_module_autoinit(
TARGETS VisualizeStaticDense2DLevelSetZeroSet
MODULES ${VTK_LIBRARIES}
)
endif()

install( TARGETS VisualizeStaticDense2DLevelSetZeroSet
DESTINATION bin/ITKExamples/Bridge/VtkGlue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,24 @@ project( VisualizeStaticMalcolm2DLevelSetLayers )
find_package( ITK REQUIRED )
include( ${ITK_USE_FILE} )

find_package( VTK REQUIRED )
include( ${VTK_USE_FILE} )
find_package( VTK REQUIRED
COMPONENTS
vtkRenderingCore
vtkRenderingGL2PSOpenGL2
)
if( VTK_VERSION VERSION_LESS "8.90.0" )
include( ${VTK_USE_FILE} )
endif()

add_executable( VisualizeStaticMalcolm2DLevelSetLayers Code.cxx )
target_link_libraries( VisualizeStaticMalcolm2DLevelSetLayers ${ITK_LIBRARIES} ${VTK_LIBRARIES} )

add_executable( VisualizeStaticMalcolm2DLevelSetLayers Code.cxx)
target_link_libraries( VisualizeStaticMalcolm2DLevelSetLayers ${ITK_LIBRARIES} )
if( NOT VTK_VERSION VERSION_LESS "8.90.0" )
vtk_module_autoinit(
TARGETS WatchRegistration
MODULES ${VTK_LIBRARIES}
)
endif()

install( TARGETS VisualizeStaticMalcolm2DLevelSetLayers
DESTINATION bin/ITKExamples/Bridge/VtkGlue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,24 @@ project( VisualizeStaticShi2DLevelSetLayers )
find_package( ITK REQUIRED )
include( ${ITK_USE_FILE} )

find_package( VTK REQUIRED )
include( ${VTK_USE_FILE} )
find_package( VTK REQUIRED
COMPONENTS
vtkRenderingCore
vtkRenderingGL2PSOpenGL2
)
if( VTK_VERSION VERSION_LESS "8.90.0" )
include( ${VTK_USE_FILE} )
endif()

add_executable( VisualizeStaticShi2DLevelSetLayers Code.cxx )
target_link_libraries( VisualizeStaticShi2DLevelSetLayers ${ITK_LIBRARIES} ${VTK_LIBRARIES} )

add_executable( VisualizeStaticShi2DLevelSetLayers Code.cxx)
target_link_libraries( VisualizeStaticShi2DLevelSetLayers ${ITK_LIBRARIES} )
if( NOT VTK_VERSION VERSION_LESS "8.90.0" )
vtk_module_autoinit(
TARGETS VisualizeStaticShi2DLevelSetLayers
MODULES ${VTK_LIBRARIES}
)
endif()

install( TARGETS VisualizeStaticShi2DLevelSetLayers
DESTINATION bin/ITKExamples/Bridge/VtkGlue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,24 @@ project( VisualizeStaticWhitaker2DLevelSetLayers )
find_package( ITK REQUIRED )
include( ${ITK_USE_FILE} )

find_package( VTK REQUIRED )
include( ${VTK_USE_FILE} )
find_package( VTK REQUIRED
COMPONENTS
vtkRenderingCore
vtkRenderingGL2PSOpenGL2
)
if( VTK_VERSION VERSION_LESS "8.90.0" )
include( ${VTK_USE_FILE} )
endif()

add_executable( VisualizeStaticWhitaker2DLevelSetLayers Code.cxx )
target_link_libraries( VisualizeStaticWhitaker2DLevelSetLayers ${ITK_LIBRARIES} ${VTK_LIBRARIES} )

add_executable( VisualizeStaticWhitaker2DLevelSetLayers Code.cxx)
target_link_libraries( VisualizeStaticWhitaker2DLevelSetLayers ${ITK_LIBRARIES} )
if( NOT VTK_VERSION VERSION_LESS "8.90.0" )
vtk_module_autoinit(
TARGETS VisualizeStaticWhitaker2DLevelSetLayers
MODULES ${VTK_LIBRARIES}
)
endif()

install( TARGETS VisualizeStaticWhitaker2DLevelSetLayers
DESTINATION bin/ITKExamples/Bridge/VtkGlue
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(ENABLE_QUICKVIEW OFF)

if(Module_ITKVtkGlue OR ITKVtkGlue_LOADED)
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
include_directories(${VTK_INCLUDE_DIRS})
set(ENABLE_QUICKVIEW ON)
add_definitions(-DENABLE_QUICKVIEW)
endif()
Expand Down
18 changes: 9 additions & 9 deletions src/Core/Common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,35 +173,35 @@ compare_to_baseline(EXAMPLE_NAME DisplayImage

add_example(DirectWarningToFile)

if(ENABLE_QUICKVIEW)

# TODO: complete example
add_example(MultiThreadOilPainting)
#==================================================

if(VTK_DIR)
add_example(FindMaxAndMinInImage)
compare_to_baseline(EXAMPLE_NAME FindMaxAndMinInImage
BASELINE_PREFIX OutputBaseline
BASELINE_PREFIX FindMaxAndMinInImageOutput
)

add_example(InPlaceFilterOfImage)
compare_to_baseline(EXAMPLE_NAME InPlaceFilterOfImage
BASELINE_PREFIX OutputBaseline
)
#TODO: Make example save output image, and then compare it to a baseline
#compare_to_baseline(EXAMPLE_NAME InPlaceFilterOfImage
# BASELINE_PREFIX OutputBaseline
# )

add_example(IterateRegionWithNeighborhood)
compare_to_baseline(EXAMPLE_NAME IterateRegionWithNeighborhood
BASELINE_PREFIX OutputBaseline
BASELINE_PREFIX IterateRegionWithWriteAccess
)

add_example(IterateRegionWithWriteAccess)
compare_to_baseline(EXAMPLE_NAME IterateRegionWithWriteAccess
BASELINE_PREFIX OutputBaseline
BASELINE_PREFIX IterateRegionWithWriteAccess
)

add_example(OutOfBoundsPixelsReturnConstValue)
compare_to_baseline(EXAMPLE_NAME OutOfBoundsPixelsReturnConstValue
BASELINE_PREFIX OutputBaseline
BASELINE_PREFIX OutOfBoundsPixelsReturnConstValue
)
endif()

Expand Down
26 changes: 23 additions & 3 deletions src/Core/Common/DisplayImage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,29 @@ project(DisplayImage)
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})


add_executable(DisplayImage Code.cxx)
target_link_libraries(DisplayImage ${ITK_LIBRARIES})
if(ENABLE_QUICKVIEW)
find_package( VTK REQUIRED
COMPONENTS
vtkRenderingCore
vtkRenderingGL2PSOpenGL2
)
if(VTK_VERSION VERSION_LESS "8.90.0")
include(${VTK_USE_FILE})
endif()

add_executable(DisplayImage Code.cxx)
target_link_libraries(DisplayImage ${ITK_LIBRARIES} ${VTK_LIBRARIES})

if(NOT VTK_VERSION VERSION_LESS "8.90.0")
vtk_module_autoinit(
TARGETS DisplayImage
MODULES ${VTK_LIBRARIES}
)
endif()
else()
add_executable(DisplayImage Code.cxx)
target_link_libraries(DisplayImage ${ITK_LIBRARIES})
endif()

install(TARGETS DisplayImage
DESTINATION bin/ITKExamples/Core/Common
Expand Down
Loading