help > RE: Batching (Command Line version?)
Aug 12, 2019  01:08 PM | Martin Styner
RE: Batching (Command Line version?)
We planned for this from the start. Most of our tools (including Auto_EACSF) can be run as a command line command. Thus, with a bit of scripting experience, it should be straightforward to batch process them.

You can run Auto_EACSF from the terminal using the "--help" tag and you will see a brief usage information:

USAGE:

Auto_EACSF [--returnparameterfile ]
[--processinformationaddress ] [--xml] [--echo]
[-t ] [--output_dir ] [--cerebmask
] [--subjectVentricleMask ]
[--segmentation ] [--brainmask ]
[--t2 ] [--t1 ] [--noGUI] [-p
] [--] [--version] [-h]
Where:
--returnparameterfile
Filename in which to write simple return parameters (int, float,
int-vector, etc.) as opposed to bulk return parameters (image,
geometry, transform, measurement, table).
--processinformationaddress
Address of a structure to store process information (progress, abort,
etc.). (value: 0)
--xml
Produce xml description of command line arguments (value: 0)
--echo
Echo the command line arguments (value: 0)
-t , --
--output_dir
Output directory
--cerebmask
Input cerebellum mask
--subjectVentricleMask
Input subject ventricle mask
--segmentation
Input brain segmentation
--brainmask
Input brainmask
--t2
Input T2 image
--t1
Input T1 image
--noGUI
Use AutoEACSF without the GUI (value: 0)
-p , --param
Input parameters in a json file
--, --ignore_rest
Ignores the rest of the labeled arguments following this flag.
--version
Displays version information and exits.
-h, --help
Displays usage information and exits.
Description: Automatically extract external CSF from T1 or T1 and T2
images.

What you need:
- save the json for the parameters and executable information
- have a way to edit the json file for all datasets (e.g. via json reading/writing in python using the json python library)
- run Auto_EACSF --noGUI --param yourParam.xml for each case with its edited json file

Martin
Originally posted by cccoleman:
We have successfully run subjects through the GUI, and are now looking for ways to batch and run hundreds of subjects through AutoEACSF.   What's the best way to do that?  

The GUI creates a series of python scripts with filenames hardcoded into the scripts as parser argument defaults/constants.  I could adapt those scripts to un-hardcode the filenames, but I suspect that would be reinventing the wheel. 

Do you have command-line only code available or advice for the easiest way to batch process?

Thanks for all your help!!  -C

Threaded View

TitleAuthorDate
cccoleman Aug 12, 2019
cccoleman Aug 16, 2019
cccoleman Aug 17, 2019
Martin Styner Aug 17, 2019
RE: Batching (Command Line version?)
Martin Styner Aug 12, 2019
cccoleman Aug 15, 2019
Martin Styner Aug 16, 2019