|
3 | 3 | """Console script for dmriprep."""
|
4 | 4 | import sys
|
5 | 5 | import click
|
| 6 | +from . import run |
| 7 | +from . import io |
| 8 | +import os |
6 | 9 |
|
7 | 10 |
|
8 | 11 | @click.command()
|
9 |
| -def main(args=None): |
10 |
| - """Console script for dmriprep.""" |
11 |
| - click.echo("Replace this message by putting your code into " |
12 |
| - "dmriprep.cli.main") |
13 |
| - click.echo("See click documentation at http://click.pocoo.org/") |
| 12 | +@click.option('--participant-label', help="The label(s) of the participant(s) that should be" |
| 13 | + "analyzed. The label corresponds to" |
| 14 | + "sub-<participant_label> from the BIDS spec (so it does" |
| 15 | + "not include 'sub-'). If this parameter is not provided" |
| 16 | + "all subjects will be analyzed. Multiple participants" |
| 17 | + "can be specified with a space separated list.", |
| 18 | + default=None |
| 19 | + ) |
| 20 | +@click.argument('bids_dir', |
| 21 | + ) |
| 22 | +@click.argument('output_dir', |
| 23 | + ) |
| 24 | +@click.argument('analysis_level', |
| 25 | + type=click.Choice(['participant', 'group']), |
| 26 | + default='participant') |
| 27 | +def main(participant_label, bids_dir, output_dir, analysis_level="participant"): |
| 28 | + """ |
| 29 | + BIDS_DIR: The directory with the input dataset formatted according to the BIDS standard. |
| 30 | +
|
| 31 | + OUTPUT_DIR: The directory where the output files should be stored. |
| 32 | + If you are running a group level analysis, this folder |
| 33 | + should be prepopulated with the results of |
| 34 | + the participant level analysis. |
| 35 | +
|
| 36 | + ANALYSIS_LEVEL: Level of the analysis that will be performed. Multiple |
| 37 | + participant level analyses can be run independently |
| 38 | + (in parallel). |
| 39 | + """ |
| 40 | + |
| 41 | + if analysis_level is not 'participant': |
| 42 | + raise NotImplementedError('The only valid analysis level for dmriprep is participant at the moment.') |
| 43 | + |
| 44 | + inputs = io.get_BIDS_files(participant_label, bids_dir) |
| 45 | + |
| 46 | + # for subject_id, subject_inputs in inputs: |
| 47 | + # run.run_dmriprep_pe(**subject_inputs, |
| 48 | + # working_dir=os.path.join(output_dir, 'scratch'), |
| 49 | + # out_dir=output_dir) |
| 50 | + click.echo('doing stuff {} {} {} {}'.format(participant_label, bids_dir, output_dir, analysis_level)) |
14 | 51 | return 0
|
15 | 52 |
|
16 | 53 |
|
|
0 commit comments