Skip to content

Commit

Permalink
Merge pull request #229 from chrisfilo/fix/manual_workflow_type
Browse files Browse the repository at this point in the history
[RTM] manual workflow type and missing T1ws error
  • Loading branch information
Shoshana Berleant committed Dec 6, 2016
2 parents 4c065a2 + 4a3c780 commit 32e36f3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
10 changes: 5 additions & 5 deletions fmriprep/run_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ def main():
help='nipype plugin configuration file')
g_input.add_argument('-w', '--work-dir', action='store',
default=op.join(os.getcwd(), 'work'))
g_input.add_argument('-t', '--workflow-type', default='ds005', required=False,
action='store', choices=['ds005', 'ds054', 'HPC', 'spiral'],
help='''workflow type, a monkeypatch while it is not
automatically identified''')
g_input.add_argument('-t', '--workflow-type', default='auto', required=False,
action='store', choices=['auto', 'ds005', 'ds054'],
help='specify workflow type manually')

# ANTs options
g_ants = parser.add_argument_group('specific settings for ANTs registrations')
Expand Down Expand Up @@ -88,7 +87,8 @@ def create_workflow(opts):
'ants_nthreads': opts.ants_nthreads,
'skull_strip_ants': opts.skull_strip_ants,
'output_dir': op.abspath(opts.output_dir),
'work_dir': op.abspath(opts.work_dir)
'work_dir': op.abspath(opts.work_dir),
'workflow_type': opts.workflow_type
}

# set up logger
Expand Down
11 changes: 8 additions & 3 deletions fmriprep/workflows/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,16 @@ def base_workflow_generator(subject_id, settings):

settings["biggest_epi_file_size_gb"] = get_biggest_epi_file_size_gb(subject_data['func'])

if subject_data['t1w'] != [] and subject_data['sbref'] != []:
if subject_data['t1w'] == []:
raise Exception("No T1w images found for participant %s. All workflows require T1w images."%subject_id)

if subject_data['sbref'] != [] or settings['workflow_type'] == "ds054":
return wf_ds054_type(subject_data, settings, name=subject_id)
if subject_data['t1w'] != [] and subject_data['sbref'] == []:
elif subject_data['sbref'] == [] or settings['workflow_type'] == "ds005":
return wf_ds005_type(subject_data, settings, name=subject_id)
return None
else:
raise Exception("Could not figure out what kind of workflow to run for this dataset.")



def wf_ds054_type(subject_data, settings, name='fMRI_prep'):
Expand Down

0 comments on commit 32e36f3

Please sign in to comment.