-
Notifications
You must be signed in to change notification settings - Fork 533
ENH: Add interface for fslorient #2955
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -1700,7 +1700,28 @@ def _gen_filename(self, name): | |||
return self._list_outputs()['out_file'] | ||||
return None | ||||
|
||||
|
||||
class FslOrientInputSpec(FSLCommandInputSpec): | ||||
in_file = File(exists=True, desc='input file', argstr='%s', position=2, mandatory=True) | ||||
main_option = traits.Str(desc='main option', argstr='-%s', position=0, mandatory=True) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this command takes a specific (and historically very stable) set of main options, it would be best to enumerate them. The current interface attempt available in SAMRI demonstrates how. |
||||
code = traits.Int(argstr='%d', desc='code for setsformcode', position=1) | ||||
|
||||
|
||||
class FslOrientOutputSpec(TraitedSpec): | ||||
out_file = File(desc = "out file", exists = True) | ||||
|
||||
|
||||
class FslOrient(FSLCommand): | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a minimal usage example analogous to that seen in other interfaces in this module: nipype/nipype/interfaces/fsl/utils.py Line 220 in e722d61
|
||||
_cmd = 'fslorient' | ||||
input_spec = FslOrientInputSpec | ||||
output_spec = FslOrientOutputSpec | ||||
|
||||
def _list_outputs(self): | ||||
outputs = self.output_spec().get() | ||||
outputs['out_file'] = os.path.abspath(self.inputs.in_file) | ||||
return outputs | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These three lines are over-indented. |
||||
|
||||
|
||||
class Reorient2StdInputSpec(FSLCommandInputSpec): | ||||
in_file = File(exists=True, mandatory=True, argstr="%s") | ||||
out_file = File(genfile=True, hash_files=False, argstr="%s") | ||||
|
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.
I would suggest adding
copyfile=True
, since this tool modifies the input file. This will only have an effect in workflows/nodes. (See https://nipype.readthedocs.io/en/latest/devel/interface_specs.html)