File tree Expand file tree Collapse file tree 3 files changed +50
-2
lines changed
src/Filtering/ImageFeature/LaplacianRecursiveGaussianImageFilter Expand file tree Collapse file tree 3 files changed +50
-2
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,21 @@ install( FILES Code.cxx CMakeLists.txt
1919)
2020
2121enable_testing ()
22+
23+ set ( input_image ${CMAKE_CURRENT_BINARY_DIR} /cthead1.png )
24+ set ( output_image Output .mha )
25+
2226add_test ( NAME LaplacianRecursiveGaussianImageFilterTest
2327 COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /LaplacianRecursiveGaussianImageFilter
24- ${CMAKE_CURRENT_BINARY_DIR} /cthead1.png
25- Output .mha
28+ ${input_image}
29+ ${output_image}
2630 )
31+
32+ if ( ITK_WRAP_PYTHON )
33+ string ( REPLACE . "Python." output_image "${output_image} " )
34+ add_test ( NAME LaplacianRecursiveGaussianImageFilterTestPython
35+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} /Code.py
36+ ${input_image}
37+ ${output_image}
38+ )
39+ endif ()
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+
3+ # Copyright NumFOCUS
4+ #
5+ # Licensed under the Apache License, Version 2.0 (the "License");
6+ # you may not use this file except in compliance with the License.
7+ # You may obtain a copy of the License at
8+ #
9+ # http://www.apache.org/licenses/LICENSE-2.0.txt
10+ #
11+ # Unless required by applicable law or agreed to in writing, software
12+ # distributed under the License is distributed on an "AS IS" BASIS,
13+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ # See the License for the specific language governing permissions and
15+ # limitations under the License.
16+
17+ import sys
18+ import itk
19+
20+ if len (sys .argv ) != 3 :
21+ print ("Usage: " + sys .argv [0 ] + " <InputFileName> <OutputFileName>" )
22+ sys .exit (1 )
23+
24+ image = itk .imread (sys .argv [1 ], pixel_type = itk .F )
25+
26+ image = itk .laplacian_recursive_gaussian_image_filter (image )
27+
28+ itk .imwrite (image , sys .argv [2 ])
Original file line number Diff line number Diff line change @@ -28,6 +28,13 @@ Results
2828Code
2929----
3030
31+ Python
32+ ......
33+
34+ .. literalinclude :: Code.py
35+ :language: python
36+ :lines: 1, 16-
37+
3138C++
3239...
3340
You can’t perform that action at this time.
0 commit comments