Skip to content

Commit

Permalink
WRAPPER: Update CLI arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Jan 19, 2023
1 parent 66cb0bb commit fdb69c0
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions wrapper/src/fmriprep_docker/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ def _get_posargs(usage):
# Make sure we're not clobbering options we don't mean to
overlap = set(w_flags).intersection(t_flags)
expected_overlap = {
'anat-derivatives',
'bids-database-dir',
'bids-filter-file',
'd',
'fs-license-file',
'fs-subjects-dir',
'output-spaces',
Expand Down Expand Up @@ -355,11 +355,12 @@ def _is_file(path, parser):
"by command-line arguments.",
)
g_wrap.add_argument(
'--anat-derivatives',
'-d',
'--derivatives',
nargs='+',
metavar='PATH',
type=os.path.abspath,
help='Path to existing sMRIPrep/fMRIPrep-anatomical derivatives to fasttrack '
'the anatomical workflow.',
action=ToDict,
help='Search PATH(s) for pre-computed derivatives.',
)
g_wrap.add_argument(
'--use-plugin',
Expand Down Expand Up @@ -546,9 +547,12 @@ def main():
command.extend(['-v', '{}:/tmp/config.toml'.format(opts.config_file)])
unknown_args.extend(['--config-file', '/tmp/config.toml'])

if opts.anat_derivatives:
command.extend(['-v', '{}:/opt/smriprep/subjects'.format(opts.anat_derivatives)])
unknown_args.extend(['--anat-derivatives', '/opt/smriprep/subjects'])
# Patch derivatives for searching
if opts.derivatives:
unknown_args.append('--derivatives')
for deriv, deriv_path in opts.derivatives.items():
command.extend(['-v', '{}:/deriv/{}:ro'.format(deriv_path, deriv)])
unknown_args.append('/deriv/{}'.format(deriv))

if opts.work_dir:
command.extend(['-v', ':'.join((opts.work_dir, '/scratch'))])
Expand Down

0 comments on commit fdb69c0

Please sign in to comment.