Hi Audrey, This is more of a Python question that OTB. You can use something like os.listdir: https://docs.python.org/3/library/os.html#os.listdir
Here's an example of python code using it: https://stackoverflow.com/a/3207973/5815110 or maybe the glob module: https://docs.python.org/3/library/glob.html Victor Poughon ________________________________ De : [email protected] [[email protected]] de la part de Audrey Riddell [[email protected]] Envoyé : jeudi 17 août 2017 20:51 À : otb-users Objet : [otb-users] Looping MeanShiftSmoothing to process a folder of rasters with Python Hello, I'm very new to Python, and I am trying to write a script that will apply the mean shift smoothing process to every file within a folder. Here is the code I am using for a single file: import otbApplication MeanShiftSmoothing = otbApplication.Registry.CreateApplication("MeanShiftSmoothing") MeanShiftSmoothing.SetParameterString("in", "C:/Users/riddella/Desktop/Raster_Clip.tif") MeanShiftSmoothing.SetParameterString("fout", "C:/Users/riddella/Desktop/Raster_Clip_Smooth.tif") MeanShiftSmoothing.SetParameterInt("spatialr", 4) MeanShiftSmoothing.SetParameterFloat("ranger", 256) MeanShiftSmoothing.SetParameterFloat("thres", 0.1) MeanShiftSmoothing.SetParameterInt("maxiter", 100) MeanShiftSmoothing.ExecuteAndWriteOutput() I want to write a loop that will apply that script to the images in, for example, folder C:/Users/riddella/Desktop/Rasters. Can someone point me in the right direction? -- -- 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. -- -- 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.
