-
Notifications
You must be signed in to change notification settings - Fork 532
FSL slice #2585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FSL slice #2585
Conversation
nipype/interfaces/fsl/utils.py
Outdated
@@ -262,6 +262,70 @@ def _format_arg(self, name, trait_spec, value): | |||
return super(Smooth, self)._format_arg(name, trait_spec, value) | |||
|
|||
|
|||
class SliceInputSpec(FSLCommandInputSpec): | |||
in_file = File(exists=True, argstr="%s", position=0, mandatory=True, | |||
desc="input filename") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this places outputs in the same directory as in_file
(unless out_base_name
is defined), you should add copyfile=False
to this trait.
nipype/interfaces/fsl/utils.py
Outdated
|
||
outbase = in_base + '_slice*' | ||
outputs['out_files'] = sorted(glob(os.path.join(out_dir, | ||
outbase + ext))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't account for if out_base_name
is an absolute path. You can simplify this a bit, too, using fname_presuffix
:
suffix = '_slice_*' + ext
if isdefined(self.inputs.out_base_name):
fname_template = os.abspath(self.inputs.out_base_name + suffix)
else:
fname_template = fname_presuffix(self.inputs.in_file, suffix=suffix, use_ext=False)
outputs['out_file'] = sorted(glob(fname_template))
Codecov Report
@@ Coverage Diff @@
## master #2585 +/- ##
==========================================
- Coverage 67.55% 67.55% -0.01%
==========================================
Files 335 335
Lines 42589 42611 +22
Branches 5269 5271 +2
==========================================
+ Hits 28772 28784 +12
- Misses 13144 13154 +10
Partials 673 673
Continue to review full report at Codecov.
|
added interface for
fslslice