Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit ed09f75

Browse files
authored
Merge pull request #31 from akeshavan/data_module
Data module
2 parents 82d161c + 12bfadb commit ed09f75

File tree

6 files changed

+910
-52
lines changed

6 files changed

+910
-52
lines changed

dmriprep/cli.py

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,51 @@
33
"""Console script for dmriprep."""
44
import sys
55
import click
6+
from . import run
7+
from . import io
8+
import os
69

710

811
@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))
1451
return 0
1552

1653

0 commit comments

Comments
 (0)