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
19
19
)
20
20
21
21
enable_testing ()
22
+
23
+ set ( input_image ${CMAKE_CURRENT_BINARY_DIR} /cthead1.png )
24
+ set ( output_image Output .mha )
25
+
22
26
add_test ( NAME LaplacianRecursiveGaussianImageFilterTest
23
27
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /LaplacianRecursiveGaussianImageFilter
24
- ${CMAKE_CURRENT_BINARY_DIR} /cthead1.png
25
- Output .mha
28
+ ${input_image}
29
+ ${output_image}
26
30
)
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
28
28
Code
29
29
----
30
30
31
+ Python
32
+ ......
33
+
34
+ .. literalinclude :: Code.py
35
+ :language: python
36
+ :lines: 1, 16-
37
+
31
38
C++
32
39
...
33
40
You can’t perform that action at this time.
0 commit comments