Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • otb otb
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 204
    • Issues 204
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 11
    • Merge requests 11
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Main Repositories
  • otbotb
  • Issues
  • #2322
Closed
Open
Issue created Jan 06, 2023 by Rémi Cresson@remicressOwner

Application engine: `ExecuteAndWriteOutputs()` does modify `m_ExecuteDone` but not `WriteOutputs()`

Description

ExecuteAndWriteOutputs() does modify m_ExecuteDone but not WriteOutputs(). Since !932 (merged), this cause an issue in the following use-case:

  1. set a filename for an output parameter image,
  2. directly use WriteOutput(),
  3. access output parameters (e.g. image metadata or size)

Since UpdateParameter() is called when the filename is set, the m_ExecuteDone is set back to false. Even if the Execute() has been properly called before setting the filename.

Steps to reproduce

Code

import otbApplication
img_pth = "/vsicurl/https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/raw/develop/Data/Input/SP67_FR_subset_1.tif?inline=false"
app = otbApplication.Registry.CreateApplication("BandMath")
app.SetParameterStringList("il", [img_pth])
app.SetParameterString("exp", "im1b1")
app.Execute()
print(app.GetImageSize("out"))  # WORKS
app.SetParameterString("out", "/tmp/toto.tif")
#print(app.GetImageSize("out"))  # ERROR, but LGTM (parameters have been modified). Not a bug.
app.WriteOutput()
print(app.GetImageSize("out"))  # ERROR: this is a bug since the whole pipeline has been executed.
                                # If we had used app.ExecuteAndWriteOutput() instead of 
                                # app.WriteOutput(), it would not have raised the error.

Output

itk::ERROR: BandMath(0x12d7870): Call Execute() or ExecuteAndWriteOutput() before trying to reach output image information

Configuration information

Ubuntu 20.04, Any OTB develop branch after !932 (merged)

Edited Jan 06, 2023 by Rémi Cresson
Assignee
Assign to
Time tracking