Showing results for 
Search instead for 
Do you mean 

Adding files to a batch process can generate incorrect output paths.

by Technical Evangelist on ‎07-19-2016 02:31 AM - edited on ‎07-20-2016 06:50 PM by Technical Evangelist (463 Views)

Question

When adding input files to a batch process from different directories it can generate incorrect output paths. The output files have the original output path, which is specified in the pattern for variable Output1, followed by the entire path structure of the input files. How can this be fixed?

Answer

This example shows the process of rescaling multiple raster files from unsigned 16 bit to unsigned 8 bit in a batch. All of the settings were specified in the Rescale tool dialog, as well as the output path of d:/data_output.

 

Step 1. Click the Batch button in the Rescale tool. The Batch Command Editor opens.

 

Step 2. To view and modify the output path choose One input, one or more outputs from the Variable menu.

 

Step 3. Turn on the Show Full Pathname option. The output path is d:/data_output.

 

Batch Command Editor.png

 

Step 4. Click the Add files... button and choose another input file from different directory. In this case it's c:/data_input. Click OK in Select Batch Files dialog.

 

Notice how the output path changed for both of the input files. The additional input path has been added to the output:

 

Batch Command Editor_path.png 

 

Step 5. To solve the issue you should click the Edit... button. The Variable Editor dialog window will open.

 

Step 6. In Variable Editor dialog select Output1 from list of Variables. In the Pattern text box delete $(Input1.pathright). The pattern for the Output1 variable will now be d:/data_output/$(Input1.root)_rescale.img. Click Insert and then click Close in the Variable Editor dialog.

 

Variable Editor.png

 

Step 7. Observer the new output path. It has been changed to one originally specified. 

 

Batch Command Editor_new_path.png

 

Step 8. Click Run Now and the process will start without any errors.

 

Process List.png

 

Contributors