Skip to content

Commit befc1b8

Browse files
committed
Added support for the -z compress option
1 parent d83b06d commit befc1b8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

nipype/interfaces/bru2nii.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ class Bru2InputSpec(CommandLineInputSpec):
2323
argstr='-f',
2424
desc="Force conversion of localizers images (multiple slice "
2525
"orientations).")
26+
compress = traits.Bool(
27+
argstr='-z', desc='gz compress images (".nii.gz").')
2628
append_protocol_name = traits.Bool(
2729
argstr='-p', desc="Append protocol name to output filename.")
2830
output_filename = traits.Str(
2931
argstr="-o %s",
30-
desc="Output filename ('.nii' will be appended)",
32+
desc='Output filename (".nii" will be appended, or ".nii.gz" if the "-z" compress option is selected)',
3133
genfile=True)
3234

3335

@@ -57,7 +59,10 @@ def _list_outputs(self):
5759
output_filename1 = os.path.abspath(self.inputs.output_filename)
5860
else:
5961
output_filename1 = self._gen_filename('output_filename')
60-
outputs["nii_file"] = output_filename1 + ".nii"
62+
if self.inputs.compress:
63+
outputs["nii_file"] = output_filename1 + ".nii.gz"
64+
else:
65+
outputs["nii_file"] = output_filename1 + ".nii"
6166
return outputs
6267

6368
def _gen_filename(self, name):

0 commit comments

Comments
 (0)