Skip to content
Snippets Groups Projects
Commit 1af65dbe authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

TEST: new test for Python wrapping of new services

parent 739241ee
Branches
Tags
No related merge requests found
...@@ -141,3 +141,9 @@ add_test( NAME pyTvBug1498 ...@@ -141,3 +141,9 @@ add_test( NAME pyTvBug1498
${OTB_DATA_ROOT}/Input/poupees.tif ${OTB_DATA_ROOT}/Input/poupees.tif
${TEMP}/Bu1498-output.tif) ${TEMP}/Bu1498-output.tif)
add_test( NAME pyTvImageInterface
COMMAND ${TEST_DRIVER} Execute
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/PythonTestDriver.py
PythonImageInterface
${OTB_DATA_ROOT}/Examples/QB_Toulouse_Ortho_XS.tif
)
def test(otb, argv):
# Create a smoothing application
app = otb.Registry.CreateApplication("Smoothing")
app.SetParameterString("in",argv[1])
app.Execute()
# Setup a special requested region
myRegion = otb.itkRegion()
myRegion.GetSize()[0] = 20
myRegion.GetSize()[1] = 25
myRegion.GetIndex().Fill(10)
app.PropagateRequestedRegion("out",myRegion)
print(app.GetImageRequestedRegion("in"))
# Create a ReadImageInfo application and plug the output of app
app2 = otb.Registry.CreateApplication("ReadImageInfo")
ex = app.ExportImage("out")
app2.ImportVectorImage("in", ex)
app2.Execute()
someKeys = ['sizex', 'sizey', 'spacingx', 'spacingy', 'sensor', 'projectionref']
for key in someKeys:
print(key + ' : ' + str(app2.GetParameterValue(key)) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment