Skip to content

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions nipype/interfaces/fsl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member

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)

Suggested change
in_file = File(exists=True, desc='input file', argstr='%s', position=2, mandatory=True)
in_file = File(exists=True,
copyfile=True,
desc='input file',
argstr='%s',
position=2,
mandatory=True)

main_option = traits.Str(desc='main option', argstr='-%s', position=0, mandatory=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The 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):
Copy link
Collaborator

Choose a reason for hiding this comment

The 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:

_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
Copy link
Member

Choose a reason for hiding this comment

The 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")
Expand Down