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?
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.
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:
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.
Step 7. Observer the new output path. It has been changed to one originally specified.
Step 8. Click Run Now and the process will start without any errors.