This is a known problem of muParser : depending on the library version, they changed the if() syntax to C++ a?b:c syntax.

The following expression should pass:
im1b1!=0 and im2b1!=0 ? 0 : im1b1

Regards,

Julien

Le 20/03/2015 14:51, dominique.hebrard a écrit :
hi everyone,

We got a problem with otb bandmath under linux Ubuntu.
We have made a serial of installation via ubuntugis depot.
Until now no problem, but this week we have made a new install and got the folowing error :

An idea about this issue ?

Cordialy
Dominique

Error using bandmath with "if" in the expression. (other simple expression are working perfectly)

Version ubuntu : 14.04.2 LTS trusty  3.13.0-46-generic
Version OTB : 4.2.0-1otb1 trusty
Version muparser : 2.2.3-3 trusty

otbcli_BandMath -il
../D2_Par_Image/APTV_05/Macro/APTV_05_Ligneux_mask_tmp.tif
../D2_Par_Image/APTV_05/Macro/APTV_05_cleaning.tif -out
../D2_Par_Image/APTV_05/Macro/APTV_05_Ligneux_mask.tif uint8 -exp
"if(im1b1!=0 and im2b1!=0,0,im1b1)"


Error :
2015 Mar 20 10:42:52  :  Application.logger  (INFO) Image #1 has 1 components

2015 Mar 20 10:42:52  :  Application.logger  (INFO) Image #2 has 1 components

Writing ../D2_Par_Image/APTV_05/Macro/APTV_05_Ligneux_mask.tif...: 0% [
                                                  ]2015 Mar 20 10:42:52
  :  Application.logger  (FATAL) The following error occurred during  
application execution :
/build/buildd/insighttoolkit4-4.6.0/Modules/Core/Common/src/itkMultiThreader.cxx:358:
itk::ERROR: MultiThreader(0x1825300): Exception occurred during
SingleMethodExecute
/build/buildd/otb-4.2.0/Code/BasicFilters/otbBandMathImageFilter.txx:292:
itk::ERROR: BandMathImageFilter(0x17fd9f0):
itk::ExceptionObject (0x19391e0)
Location: "unknown"
File: /build/buildd/otb-4.2.0/Code/Common/otbParser.cxx
Line: 168
Description: itk::ERROR: ParserImpl(0x17892b0):
Message:     Unexpected token "if" found at position 0.
Formula:     if(im1b1!=0 and im2b1!=0,0,im1b1)
Token:       if
Position:    0


--
--
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html

You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
---
You received this message because you are subscribed to the Google Groups "otb-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.


--
Julien MICHEL
CNES - DCT/SI/AP - BPI 1219
18, avenue Edouard Belin
31401 Toulouse Cedex 09 - France
Tel: +33 561 282 894 - Fax: +33 561 283 109

--
--
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html

You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
--- You received this message because you are subscribed to the Google Groups "otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to