From 46e659b941dddfcb1d1461876115dcf96b7bcfcb Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Mon, 29 Oct 2018 00:36:44 +0100 Subject: [PATCH] Added support for the -z compress option --- nipype/interfaces/bru2nii.py | 9 +++++++-- nipype/interfaces/tests/test_auto_Bru2.py | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/nipype/interfaces/bru2nii.py b/nipype/interfaces/bru2nii.py index c1c1484d38..4261f308a9 100644 --- a/nipype/interfaces/bru2nii.py +++ b/nipype/interfaces/bru2nii.py @@ -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) @@ -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): diff --git a/nipype/interfaces/tests/test_auto_Bru2.py b/nipype/interfaces/tests/test_auto_Bru2.py index d386b3f095..ce436ac03e 100644 --- a/nipype/interfaces/tests/test_auto_Bru2.py +++ b/nipype/interfaces/tests/test_auto_Bru2.py @@ -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,