RE:[otb-users] OTB Python setting parameters
Thank you for your answer, It seems to work. Baptiste Meylheuc De : otb-users@googlegroups.com [otb-users@googlegroups.com] de la part de Jordi Inglada [jordi.ingl...@cesbio.eu] Envoyé : lundi 19 juin 2017 13:28 À : otb-users@googlegroups.com Objet : Re: [otb-users] OTB Python setting parameters Hi, I think you have to call the UpdateParameters() method on your application object before setting the channels. Jordi On Mon 19-Jun-2017 at 11:02:03 +0200, Meylheuc Baptiste <baptiste.meylh...@cnes.fr> wrote: > Hello, > > I'm trying to write an otb quicklook function on Python, it works fine until > I have to set the channel parameter: "-cl", both with the old and new way of > setting it. In red, all the differents tests I've done, unsuccessfully. > > quicklook = otbApplication.Registry_CreateApplication('Quicklook') > quicklook.IN = 'image.tif' > quicklook.SR = 8 > quicklook.OUT = 'image_quicklook.tif' > quicklook.CL = [4,3,2] > quicklook.CL = '[4,3,2]' > quicklook.CL = '4,3,2' > ==> Attribute Error > > quicklook.SetParameterStringList('cl', '[4,3,2]') > quicklook.SetParameterStringList('cl', '4,3,2') > quicklook.SetParameterStringList('cl',['4','3','2']) > quicklook.SetParameterStringList('cl',['4','3','2']) > ==> RuntimeError: Exception thrown in otbApplication > Application_SetParameterStringList: > /home/meylheucb/Documents/OTB/otb/Modules/Wrappers/ApplicationEngine/src/otbWrapperListViewParameter.cxx:194: > itk::ERROR: ListViewParameter(0x22abb80): Value 4 not found in the list of > choices > > quicklook.ExecuteAndWriteOutput() > > What is the right way to write it ? Notice that it doesn't work anymore with > only one selected band. > In advance, thank you for your help. > > Best regards, > > Baptiste Meylheuc > > -- -- -- 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 otb-users@googlegroups.com To unsubscribe from this group, send email to otb-users+unsubscr...@googlegroups.com 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 otb-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- -- 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 otb-users@googlegroups.com To unsubscribe from this group, send email to otb-users+unsubscr...@googlegroups.com 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 otb-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [otb-users] OTB Python setting parameters
Hi, I think you have to call the UpdateParameters() method on your application object before setting the channels. Jordi On Mon 19-Jun-2017 at 11:02:03 +0200, Meylheuc Baptistewrote: > Hello, > > I'm trying to write an otb quicklook function on Python, it works fine until > I have to set the channel parameter: "-cl", both with the old and new way of > setting it. In red, all the differents tests I've done, unsuccessfully. > > quicklook = otbApplication.Registry_CreateApplication('Quicklook') > quicklook.IN = 'image.tif' > quicklook.SR = 8 > quicklook.OUT = 'image_quicklook.tif' > quicklook.CL = [4,3,2] > quicklook.CL = '[4,3,2]' > quicklook.CL = '4,3,2' > ==> Attribute Error > > quicklook.SetParameterStringList('cl', '[4,3,2]') > quicklook.SetParameterStringList('cl', '4,3,2') > quicklook.SetParameterStringList('cl',['4','3','2']) > quicklook.SetParameterStringList('cl',['4','3','2']) > ==> RuntimeError: Exception thrown in otbApplication > Application_SetParameterStringList: > /home/meylheucb/Documents/OTB/otb/Modules/Wrappers/ApplicationEngine/src/otbWrapperListViewParameter.cxx:194: > itk::ERROR: ListViewParameter(0x22abb80): Value 4 not found in the list of > choices > > quicklook.ExecuteAndWriteOutput() > > What is the right way to write it ? Notice that it doesn't work anymore with > only one selected band. > In advance, thank you for your help. > > Best regards, > > Baptiste Meylheuc > > -- -- -- 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 otb-users@googlegroups.com To unsubscribe from this group, send email to otb-users+unsubscr...@googlegroups.com 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 otb-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[otb-users] OTB Python setting parameters
Hello, I'm trying to write an otb quicklook function on Python, it works fine until I have to set the channel parameter: "-cl", both with the old and new way of setting it. In red, all the differents tests I've done, unsuccessfully. quicklook = otbApplication.Registry_CreateApplication('Quicklook') quicklook.IN = 'image.tif' quicklook.SR = 8 quicklook.OUT = 'image_quicklook.tif' quicklook.CL = [4,3,2] quicklook.CL = '[4,3,2]' quicklook.CL = '4,3,2' ==> Attribute Error quicklook.SetParameterStringList('cl', '[4,3,2]') quicklook.SetParameterStringList('cl', '4,3,2') quicklook.SetParameterStringList('cl',['4','3','2']) quicklook.SetParameterStringList('cl',['4','3','2']) ==> RuntimeError: Exception thrown in otbApplication Application_SetParameterStringList: /home/meylheucb/Documents/OTB/otb/Modules/Wrappers/ApplicationEngine/src/otbWrapperListViewParameter.cxx:194: itk::ERROR: ListViewParameter(0x22abb80): Value 4 not found in the list of choices quicklook.ExecuteAndWriteOutput() What is the right way to write it ? Notice that it doesn't work anymore with only one selected band. In advance, thank you for your help. Best regards, Baptiste Meylheuc -- -- 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 otb-users@googlegroups.com To unsubscribe from this group, send email to otb-users+unsubscr...@googlegroups.com 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 otb-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.