How-to: Process multiple data sets in Stradview

Stradview provides a scripting feature which allows you to run the same operations over multiple data sets. This was primarily designed for Cortical Bone Mapping, but it can be used for other operations which do not require manual interaction, and for reporting Stradview parameters from multiple files.

In order to run operations over multiple files, these files must be organised in a well-defined way. Both the file naming and directory structure need to be sufficiently uniform, so that it is easy to define a naming pattern which will only load the files in which you are interested. You should also have already performed any manual actions in these files which were necessary. For instance, if the processing is surface-based, the outlines should all be created, and the objects of interest ideally all named in the same manner. Alternatively, if you are loading in surfaces created by other software, these should all be named consistently and stored in the same directory as each corresponding Stradview file. You should also have placed any required landmarks, for instance to assist with DICOM calibration.

The script itself is written and run using the script task. As this example shows, both data and textual output from scripts are all written to a specific location. Any resources from each file can be listed so they are written out to the textual output. This output can be pasted into a spreadsheet in order to record specific details of all the files which were processed. Any resource can be written (using 'param') by a script and, since nearly all of the slider positions and other control values are stored as resources, most of the Stradview controls can be adjusted by writing to resources. The main exceptions to this are the various buttons and menu options: some of these are implemented (using 'func') with specific script functions, but not all are accessible. Many of the cursor and other key presses (using 'func') are also implemented.

The script essentially contains an outer loop over each data set (surrounded by 'open' and 'close' commands), and often also an inner loop over each surface (surrounded by 'loop' and 'end' commands). When the script is run, it is first checked: and this stage also reports what data sets have been found and will be opened.

Stradview can also be run directly with a script, either by dragging and dropping a script file over the Stradview executable, or running from the command line with the script file as the first argument. In this case, Stradview automatically closes when the script has finished. This allows Stradview operations to be included as a part of external scripts.