Dear Julien,

Thanks for your feedback.
It is true that current syntax is somewhere in-between different standards.
About the use of "band[]" as general syntax, it would not be consistent with other extended filenames : we always use "keyword=value". So, it should be something like "band=[]".

Regards,
Guillaume

On 02/25/2017 10:41 AM, Julien Radoux wrote:
Dear Guillaume,

This would be usefull, thanks. I don't care about band or bands. for the syntax, Python-like is nice, but then it is confusing not to start with band 0 for the first band. maybe using [] would also make things clear. To be more "pythonic", I would rather use bands[] with the python indices but this is probably more difficult to parse. Also, in python, [2:4] would mean bands with index 2 and 3 (not the 4), so this is not consistent.

To conclude, Python-like is fine, but it would be very confusing if there are too many differences. In your example, it makes me think of Matlab indexing, which is fine but should be stated as such in the help (then use "end" instead of -1 for the last band)

For the last question, I do have some home made scripts that could benefit from band selection in the extended filename. One application with a standard filter would be the use of Meanshift segmentation where you only want the smoothed mean value for one of the output bands (e.g. a NDVI band) but you want to use more than one band as input for the mean shift segmentation.



Le vendredi 24 février 2017 17:25:37 UTC+1, Guillaume Pasero a écrit :

Dear users,

A new feature is in development to provide an extended filename for input band selection (see extended_band). A simple use-case is when you have a multi-channel image, and you want to process only the second band of this image using an OTB Application. With this feature you could do it like this :

otbcli_MyApplication -in  "my_image.tif?band=2"  -out output.tif

The current syntax (inspired by Python syntax) has already been implemented :
  • band=r1,r2,...,rn     where each 'ri' is a generic range
  • A generic range can be :
    • A single band index : '1' is the first band, for negative numbers the numbering is backward ( '-1' is the last band)
    • A range of bands, using the character ':' between optional start and end indexes :
      • '3:' means the 3rd band until the last one
      • ':-2' means the first band until the second to last
      • '2:4' means bands 2, 3 and 4

We would like to have your feedback on several points :
  • We will likely change the keyword "band" to plural "bands", no objection ?
  • Is the syntax clear / convenient / confusing ?
  • There can be a debate between 0-based and 1-based indexing for band numbers. At the moment, it is not uniform in OTB but we think that 1-based indexing should be the convention exposed to the user.
  • It is also possible to implement it on image writers, would it help ? What would be your use-cases ?
Thanks for your feedback,

Guillaume
--
Guillaume PASERO
Responsable technique
Business Unit ESPACE & GeoInformation - Département Payload Data & Applications

CS Systèmes d'Information
Parc de la Grande Plaine - 5, Rue Brindejonc des Moulinais - BP 15872
31506 Toulouse Cedex 05 - FRANCE
+33 561 17 64 21 - [email protected]
--
--
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.

--
Guillaume PASERO
Responsable technique
Business Unit ESPACE & GeoInformation - Département Payload Data & Applications

CS Systèmes d'Information
Parc de la Grande Plaine - 5, Rue Brindejonc des Moulinais - BP 15872
31506 Toulouse Cedex 05 - FRANCE
+33 561 17 64 21 - [email protected]

--
--
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