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:


Auto_EACSF [--returnparameterfile ]
[--processinformationaddress ] [--xml] [--echo]
[-t ] [--output_dir ] [--cerebmask
] [--subjectVentricleMask ]
[--segmentation ] [--brainmask ]
[--t2 ] [--t1 ] [--noGUI] [-p
] [--] [--version] [-h]
Filename in which to write simple return parameters (int, float,
int-vector, etc.) as opposed to bulk return parameters (image,
geometry, transform, measurement, table).
Address of a structure to store process information (progress, abort,
etc.). (value: 0)
Produce xml description of command line arguments (value: 0)
Echo the command line arguments (value: 0)
-t , --
Output directory
Input cerebellum mask
Input subject ventricle mask
Input brain segmentation
Input brainmask
Input T2 image
Input T1 image
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.
Displays version information and exits.
-h, --help
Displays usage information and exits.
Description: Automatically extract external CSF from T1 or T1 and T2

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

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

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