File tree Expand file tree Collapse file tree 3 files changed +41
-1
lines changed
src/IO/ImageBase/ReadAnImage Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,17 @@ install( FILES Code.cxx CMakeLists.txt
18
18
COMPONENT Code
19
19
)
20
20
21
+ set ( input_image ${CMAKE_CURRENT_BINARY_DIR} /Yinyang.png )
22
+
21
23
enable_testing ()
22
24
add_test ( NAME ReadAnImageTest
23
25
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /ReadAnImage
24
- ${CMAKE_CURRENT_BINARY_DIR} /Yinyang.png
26
+ ${input_image}
25
27
)
28
+
29
+ if (ITK_WRAP_PYTHON )
30
+ add_test (NAME ReadAnImageTestPython
31
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} /Code.py
32
+ ${input_image}
33
+ )
34
+ 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 ) != 2 :
21
+ print ("Usage: " + sys .argv [0 ] + " <InputFileName>" )
22
+ sys .exit (1 )
23
+
24
+ image = itk .imread (sys .argv [1 ])
Original file line number Diff line number Diff line change 22
22
Code
23
23
----
24
24
25
+ Python
26
+ ......
27
+
28
+ .. literalinclude :: Code.py
29
+ :language: python
30
+ :lines: 1, 16-
31
+
25
32
C++
26
33
...
27
34
You can’t perform that action at this time.
0 commit comments