run_remodel¶
Main command-line program for running the remodeling tools.
Functions
Create a parser for the run_remodel command-line arguments. |
|
|
Restore the backup if applicable. |
|
The command-line program. |
|
Parse the command line arguments or arg_list if given. |
|
Parse the tasks argument to get a task list. |
|
Run the remodeler on a BIDS dataset. |
|
Run the remodeler on files of a specified form in a directory tree. |
- get_parser()[source]¶
Create a parser for the run_remodel command-line arguments.
- Returns:
A parser for parsing the command line arguments.
- Return type:
argparse.ArgumentParser
- handle_backup(args)[source]¶
Restore the backup if applicable.
- Parameters:
args (obj) – Parsed arguments as an object.
- Returns:
Backup name if there was a backup done.
- Return type:
str or None
- main(arg_list=None)[source]¶
The command-line program.
- Parameters:
arg_list (list or None) – Called with value None when called from the command line. Otherwise, called with the command-line parameters as an argument list.
- Raises:
if the data root directory does not exist.
if the specified backup does not exist.
- parse_arguments(arg_list=None)[source]¶
Parse the command line arguments or arg_list if given.
- Parameters:
arg_list (list) – List of command line arguments as a list.
- Returns:
Argument object. List: A list of parsed operations (each operation is a dictionary).
- Return type:
Object
- Raises:
ValueError –
If the operations were unable to be correctly parsed.
- parse_tasks(files, task_args)[source]¶
Parse the tasks argument to get a task list.
- Parameters:
files (list) – List of full paths of files.
task_args (str or list) – The argument values for the task parameter.
- run_bids_ops(dispatch, args, tabular_files)[source]¶
Run the remodeler on a BIDS dataset.
- Parameters:
dispatch (Dispatcher) – Manages the execution of the operations.
args (Object) – The command-line arguments as an object.
tabular_files (list) – List of tabular files to run the ops on.
- run_direct_ops(dispatch, args, tabular_files)[source]¶
Run the remodeler on files of a specified form in a directory tree.
- Parameters:
dispatch (Dispatcher) – Controls the application of the operations and backup.
args (argparse.Namespace) – Dictionary of arguments and their values.
tabular_files (list) – List of files to include in this run.