Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 7 additions & 2 deletions nipype/interfaces/bru2nii.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ class Bru2InputSpec(CommandLineInputSpec):
argstr='-f',
desc="Force conversion of localizers images (multiple slice "
"orientations).")
compress = traits.Bool(
argstr='-z', desc='gz compress images (".nii.gz").')
append_protocol_name = traits.Bool(
argstr='-p', desc="Append protocol name to output filename.")
output_filename = traits.Str(
argstr="-o %s",
desc="Output filename ('.nii' will be appended)",
desc='Output filename (".nii" will be appended, or ".nii.gz" if the "-z" compress option is selected)',
genfile=True)


Expand Down Expand Up @@ -57,7 +59,10 @@ def _list_outputs(self):
output_filename1 = os.path.abspath(self.inputs.output_filename)
else:
output_filename1 = self._gen_filename('output_filename')
outputs["nii_file"] = output_filename1 + ".nii"
if self.inputs.compress:
outputs["nii_file"] = output_filename1 + ".nii.gz"
else:
outputs["nii_file"] = output_filename1 + ".nii"
return outputs

def _gen_filename(self, name):
Expand Down
1 change: 1 addition & 0 deletions nipype/interfaces/tests/test_auto_Bru2.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def test_Bru2_inputs():
actual_size=dict(argstr='-a', ),
append_protocol_name=dict(argstr='-p', ),
args=dict(argstr='%s', ),
compress=dict(argstr='-z', ),
environ=dict(
nohash=True,
usedefault=True,
Expand Down