Batch and Script
Brief description: The
batch
process makes it possible to apply sequence of operations to a number
of images unattended. To create the batch process, you need to prepare
a special text file(s) containing the batch commands. Such files are called
script files.
Among
other things, you can create a script file for standard processing of
a loaded image and use this file to handle a number of images. To do so,
you have to create a script file containing, for every image, the sequence
of commands that load an image, invoke the standard processing scenario,
and then save the resulting image.
Script Studio
Script - is a sequence of operations, which can be executed unattended.
Let us consider an example of creating a Script on the basis of raster image
calibration.
Prepare data to start Script:
- Prepare document (*.cws): open the raster image, customize the User Coordinate System (UCS), save
the document (Map.cws).
- Prepare calibration template: set calibration pairs - grid and measured points, save the calibration pairs
in file (map.tpl).
More
detailed Information is provided in section How to calibrate an image.
INFORMATION: You can also set calibration
pairs and save them in the document file.
Prepare, save,
and start Script (*.csf):
Define the calibration execution order:
- Open document (*.cws);
- Start calibration using calibration template (*.tpl);
- Save document with calibrated image with a different name.
Choose the command Script Studio from the Tools
menu. Using the Edit Scripts dialog box:
|
Choose File from the Category list;
choose Open Document from the list of commands of the
File category; and move the selected command
to the Script field.
|
 |
|
Click on “+” to open the sub-category, which contains the chosen command
options.
|
|
Specify name and folder for the document file - Map.cws
|
| From the Category list, choose Image; from the
list of commands choose Calibration; and move the selected
command to the Script field. |
 |
|
Open the sub-category of calibration options and specify the pre-defined calibration
template file - map.tpl.
|
|
From the Category list choose File; from the list
of commands choose Save as Document.
Open the sub-folder of the command options and specify in the File Name
field - the location and name of the resulting file, and
|
|
| in the File Type field - the type of the resulting file,for all needed fields. |
- To save the Script (*.csf) file press the Save As button of the
Edit Script dialog.
- To start the Script:
- Press the Run button of the Edit Script dialog.
- If the script file has been previously saved, choose Run Script
from the Tools menu, then choose the required script
file from the open Script File dialog.
| When starting a Script, the lower-right corner of the Edit Script
dialog displays a report on the command execution. |
 |
TIPS: Save the report to file, specify Set Log File
as the first Script command, selecting name and location of the report
file as parameters.
TIPS: For fast navigation, you can set All
Commands in the list of categories of the Edit Script
dialog, and then you can choose a command by pressing its first letter.
Batch Studio
Batch - is a specified sequence of
Scripts to process files.
It is convenient to use the Batch option when you need to apply regular operations
to several raster images.
Before creating a Batch, you need to prepare a set of Scripts,
which describe commands for processing. You do not need to describe the
commands for opening, inserting and saving files in Scripts,
prepared for Batch, as these operations are performed with the Batch studio
tools.
Look at the following example of creating a Batch:
Prepare data to start Batch:
|
Prepare script, which perform the commands: Deskew, Crop, Rotate by 900
and save it as Deskew_Crop_Rotate.csf.
|
|
|
Prepare script, which performs the 4-point correction for images of format ISO A4
and save it as 4p_correction_ISO_A4.csf.
|
|
You can create and save scripts in Script studio.
Information on creating Scripts
is provided above.
Prepare
and start Batch
Choose the Batch Studio command from the Tools menu
in the open Run Batch dialog:
|
From the list of folders, located in the left part of the Run Batch
dialog, choose the files, or folders with files to process and using
drag&drop move them to the Input files or directories
field.
INFORMATION: You can use * to specify names for files,
e.g., if you specify …\Images\*.tif, only files with extension
tif (contained in the Images folder) will be processed.
From the list of folders, located in the left part of the Run Batch
dialog, select the prepared Scripts files, and drag and drop them
to the Script files list field.
|
 |
|
If you want to save the processed files in a different folder (with different
name or extension), select the Use output directory
checkbox. Specify a name for the folder. Otherwise, the processed
files will overwrite the originals.
Press the Run button of the Run Batch dialog.
|
| When starting a Batch, The lower-right corner of the Run Batch
dialog displays a report on the command execution. |
 |
|