Skip to content

Commit cddc856

Browse files
committed
BUG: Fix input for examples that use VTK
After fixing the CMakeList.txt scipts for examples that use VTK library in some form, many of the examples needed there test input and documentation updated. This primarily added an input image for an examples test, and updated it's respective documentation.txt with the input and output. A few of the examples and/or their respective tests contained errors that were marked with a TODO, for a future PR. These included: 1) Baseline comparisons, that cannot work due to the output not ever being stored. In a future PR, the examples should be modified to save their output, so we can test against it. + VTKImageToITKImageBaseline + InPlaceFilterOfImageBaseline + GeometricPropertiesOfRegionBaseline 2) The DemonstrateThresholdAlgorithm example has it's KittlerIllingworth filter commented out with a TODO. This was the only filter to not work, and will be documented in a future issue.
1 parent f079817 commit cddc856

29 files changed

+104
-49
lines changed

src/Bridge/VtkGlue/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ add_example(ConvertRGBvtkImageDataToAnitkImage)
66
if(ENABLE_QUICKVIEW)
77

88
add_example(VTKImageToITKImage)
9-
compare_to_baseline(EXAMPLE_NAME VTKImageToITKImage
10-
BASELINE_PREFIX OutputBaseline
11-
)
9+
#TODO: Save output ITK image and then use it to compare to baseline
10+
#compare_to_baseline(EXAMPLE_NAME VTKImageToITKImage
11+
# BASELINE_PREFIX OutputBaseline
12+
# )
1213

1314
if(ITK_VERSION_MAJOR LESS 5)
1415
add_example(VisualizeEvolvingDense2DLevelSetAsElevationMap)

src/Bridge/VtkGlue/VTKImageToITKImage/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ install(FILES Code.cxx CMakeLists.txt
3939

4040
enable_testing()
4141
add_test(NAME VTKImageToITKImageTest
42-
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/VTKImageToITKImage)
42+
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/VTKImageToITKImage Gourds.png)
4343

src/Bridge/VtkGlue/VTKImageToITKImage/Documentation.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
VTK Image To ITK Image
22
======================
3-
.. warning::
4-
**Fix Problem**
5-
Contains problems not fixed from original wiki.
63
.. index::
74
single: VTKImageToImageFilter
85

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

1512
Results
1613
-------
17-
.. note::
18-
**Help Wanted**
19-
Implementation of Results for sphinx examples containing this message.
20-
Reconfiguration of CMakeList.txt may be necessary.
21-
`Write An Example <https://itk.org/ITKExamples/Documentation/Contribute/WriteANewExample.html`>
14+
.. figure:: Gourds.png
15+
:scale: 50%
16+
:alt: Input image.
17+
18+
Input Image
19+
20+
.. figure:: VTKImageToITKImageQuickview.png
21+
:scale: 50%
22+
:alt: QuickView output.
23+
24+
Output In QuickView
2225

2326
Code
2427
----
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
859fd5a9de82ac8bbdf81c1c75548ce340c36c46396c8f63bbe709fe572af54df3bf69e18ece04e84977db3fee7aafc50ea6d51926cec1891661fb45a1762907
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1b114c209ad010f6710b8c63a2a3ef66dc237d5efc7eb12dcb6a2105535f1c9ee568bd0bd646acd8da78c6468c257e857956a6d5518546461a796452e4c6c689

src/Core/Common/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,10 @@ compare_to_baseline(EXAMPLE_NAME FindMaxAndMinInImage
184184
)
185185

186186
add_example(InPlaceFilterOfImage)
187-
compare_to_baseline(EXAMPLE_NAME InPlaceFilterOfImage
188-
BASELINE_PREFIX OutputBaseline
189-
)
187+
#TODO: Make example save output image, and then compare it to a baseline
188+
#compare_to_baseline(EXAMPLE_NAME InPlaceFilterOfImage
189+
# BASELINE_PREFIX OutputBaseline
190+
# )
190191

191192
add_example(IterateRegionWithNeighborhood)
192193
compare_to_baseline(EXAMPLE_NAME IterateRegionWithNeighborhood

src/Core/Common/FindMaxAndMinInImage/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ install(FILES Code.cxx CMakeLists.txt
3838

3939
enable_testing()
4040
add_test(NAME FindMaxAndMinInImageTest
41-
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/FindMaxAndMinInImage)
41+
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/FindMaxAndMinInImage Yinyang.png)

src/Core/Common/InPlaceFilterOfImage/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ install(FILES Code.cxx CMakeLists.txt
3838

3939
enable_testing()
4040
add_test(NAME InPlaceFilterOfImageTest
41-
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/InPlaceFilterOfImage)
41+
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/InPlaceFilterOfImage Gourds.png)

src/Core/Common/InPlaceFilterOfImage/Documentation.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
In Place Filter Of Image
22
========================
3-
.. warning::
4-
**Fix Problem**
5-
Contains problems not fixed from original wiki.
63
.. index::
74
single: InPlaceImageFilter
85

@@ -14,12 +11,17 @@ In-place filtering of an image.
1411

1512
Results
1613
-------
17-
.. note::
18-
**Help Wanted**
19-
Implementation of Results for sphinx examples containing this message.
20-
Reconfiguration of CMakeList.txt may be necessary.
21-
`Write An Example <https://itk.org/ITKExamples/Documentation/Contribute/WriteANewExample.html`>
14+
.. figure:: Gourds.png
15+
:scale: 50%
16+
:alt: Input image.
2217

18+
Input Image
19+
20+
.. figure:: InPlaceFilterOfImageQuickview.png
21+
:scale: 50%
22+
:alt: QuickView output.
23+
24+
Output In QuickView
2325
Code
2426
----
2527

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
859fd5a9de82ac8bbdf81c1c75548ce340c36c46396c8f63bbe709fe572af54df3bf69e18ece04e84977db3fee7aafc50ea6d51926cec1891661fb45a1762907

0 commit comments

Comments
 (0)