Skip to content

Commit

Permalink
Merge pull request #197 from mwaskom/nipype_fixes
Browse files Browse the repository at this point in the history
Adapt to changes in nipype
  • Loading branch information
mwaskom authored Apr 9, 2020
2 parents 6701801 + 7efb189 commit d75749a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
5 changes: 4 additions & 1 deletion lyman/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,10 @@ def execute(wf, args, info):
else:

# TODO expose other nipype plugins as a command-line parameter
plugin, plugin_args = "MultiProc", {"n_procs": args.n_procs}
if args.n_procs == 1:
plugin, plugin_args = "Linear", {}
else:
plugin, plugin_args = "MultiProc", {"n_procs": args.n_procs}
res = wf.run(plugin, plugin_args)

# After successful completion of the workflow, optionally delete the
Expand Down
20 changes: 10 additions & 10 deletions lyman/workflows/preproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,14 +503,14 @@ def write_time_series_gif(self, runtime, img, fname, title=None):
class SessionInput(LymanInterface):

class input_spec(TraitedSpec):
session = traits.Tuple()
session = traits.Tuple(traits.Str(), traits.Str())
data_dir = traits.Directory(exists=True)
proc_dir = traits.Directory(exists=True)
fm_template = traits.Str()
phase_encoding = traits.Either("ap", "pa")

class output_spec(TraitedSpec):
session_tuple = traits.Tuple()
session_tuple = traits.Tuple(traits.Str(), traits.Str())
subject = traits.Str()
session = traits.Str()
fm_file = traits.File(exists=True)
Expand Down Expand Up @@ -596,7 +596,7 @@ def _run_interface(self, runtime):
class RunInput(LymanInterface, TimeSeriesGIF):

class input_spec(TraitedSpec):
run = traits.Tuple()
run = traits.Tuple(traits.Str(), traits.Str(), traits.Str())
data_dir = traits.Directory(exists=True)
proc_dir = traits.Directory(exists=True)
experiment = traits.Str()
Expand All @@ -605,7 +605,7 @@ class input_spec(TraitedSpec):
crop_frames = traits.Int(0, usedefault=True)

class output_spec(TraitedSpec):
run_tuple = traits.Tuple()
run_tuple = traits.Tuple(traits.Str(), traits.Str(), traits.Str())
subject = traits.Str()
session = traits.Str()
run = traits.Str()
Expand Down Expand Up @@ -725,7 +725,7 @@ class input_spec(TraitedSpec):
warp_files = traits.List(traits.File(exists=True))
jacobian_files = traits.List(traits.File(Exists=True))
phase_encoding = traits.List(traits.Str)
session_tuple = traits.Tuple()
session_tuple = traits.Tuple(traits.Str(), traits.Str())

class output_spec(TraitedSpec):
raw_file = traits.File(exists=True)
Expand Down Expand Up @@ -896,7 +896,7 @@ class FinalizeTimeseries(LymanInterface, TimeSeriesGIF):

class input_spec(TraitedSpec):
experiment = traits.Str()
run_tuple = traits.Tuple()
run_tuple = traits.Tuple(traits.Str(), traits.Str(), traits.Str())
anat_file = traits.File(exists=True)
in_files = traits.List(traits.File(exists=True))
seg_file = traits.File(exists=True)
Expand Down Expand Up @@ -1038,7 +1038,7 @@ class FinalizeTemplate(LymanInterface):

class input_spec(TraitedSpec):
experiment = traits.Str()
session_tuple = traits.Tuple()
session_tuple = traits.Tuple(traits.Str(), traits.Str())
in_files = traits.List(traits.File(exists=True))
seg_file = traits.File(exists=True)
anat_file = traits.File(exists=True)
Expand Down Expand Up @@ -1170,7 +1170,7 @@ class RealignmentReport(LymanInterface):
class input_spec(TraitedSpec):
target_file = traits.File(exists=True)
realign_params = traits.File(exists=True)
run_tuple = traits.Tuple()
run_tuple = traits.Tuple(traits.Str(), traits.Str(), traits.Str())

class output_spec(TraitedSpec):
params_plot = traits.File(exists=True)
Expand Down Expand Up @@ -1237,7 +1237,7 @@ class AnatRegReport(LymanInterface):

class input_spec(TraitedSpec):
subject_id = traits.Str()
session_tuple = traits.Tuple()
session_tuple = traits.Tuple(traits.Str(), traits.Str())
data_dir = traits.Directory(exists=True)
in_file = traits.File(exists=True)
cost_file = traits.File(exists=True)
Expand Down Expand Up @@ -1279,7 +1279,7 @@ def _run_interface(self, runtime):
class CoregGIF(LymanInterface):

class input_spec(TraitedSpec):
run_tuple = traits.Tuple()
run_tuple = traits.Tuple(traits.Str(), traits.Str(), traits.Str())
in_file = traits.File(exists=True)
ref_file = traits.File(exists=True)
out_file = traits.File()
Expand Down

0 comments on commit d75749a

Please sign in to comment.