From 01fa94e82e12b98ad2890187398832485e3c9f29 Mon Sep 17 00:00:00 2001 From: Steven Tilley Date: Tue, 20 Aug 2019 17:56:24 -0400 Subject: [PATCH 1/3] Add index_mask_file input to ImageStats Allows fslstats calls with the -K option --- .zenodo.json | 5 +++++ nipype/interfaces/fsl/utils.py | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index ee1771da97..bf1cb6f692 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -695,6 +695,11 @@ "affiliation": "MIT, HMS", "name": "Ghosh, Satrajit", "orcid": "0000-0002-5312-6729" + }, + { + "affiliation": "Holland Bloorview Kids Rehabilitation Hospital", + "name": "Tilley II, Steven", + "orcid": "0000-0003-4853-5082" } ], "keywords": [ diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index f4ef73c0e9..6985c880a8 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -725,18 +725,20 @@ class ImageStatsInputSpec(FSLCommandInputSpec): exists=True, argstr="%s", mandatory=True, - position=2, + position=3, desc='input file to generate stats of') op_string = traits.Str( argstr="%s", mandatory=True, - position=3, + position=4, desc=("string defining the operation, options are " "applied in order, e.g. -M -l 10 -M will " "report the non-zero mean, apply a threshold " "and then report the new nonzero mean")) mask_file = File( exists=True, argstr="", desc='mask file used for option -k %s') + index_mask_file = File( + exists=True, argstr="-K %s", position=2) class ImageStatsOutputSpec(TraitedSpec): From ac54739effc8fdd7d89a57b5aac91b3f7cefd760 Mon Sep 17 00:00:00 2001 From: Steven Tilley Date: Wed, 21 Aug 2019 10:51:48 -0400 Subject: [PATCH 2/3] add new autogenerated test file --- nipype/interfaces/fsl/tests/test_auto_ImageStats.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nipype/interfaces/fsl/tests/test_auto_ImageStats.py b/nipype/interfaces/fsl/tests/test_auto_ImageStats.py index 0230245f2e..f2dc0af947 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ImageStats.py +++ b/nipype/interfaces/fsl/tests/test_auto_ImageStats.py @@ -14,6 +14,11 @@ def test_ImageStats_inputs(): argstr='%s', extensions=None, mandatory=True, + position=3, + ), + index_mask_file=dict( + argstr='-K %s', + extensions=None, position=2, ), mask_file=dict( @@ -23,7 +28,7 @@ def test_ImageStats_inputs(): op_string=dict( argstr='%s', mandatory=True, - position=3, + position=4, ), output_type=dict(), split_4d=dict( From 22efaf766bef74221fabb1f6f0dba4dde954c704 Mon Sep 17 00:00:00 2001 From: Steven Tilley Date: Thu, 22 Aug 2019 17:19:46 -0400 Subject: [PATCH 3/3] add index_mask_file desc Change by @effigies Co-Authored-By: Chris Markiewicz --- nipype/interfaces/fsl/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index 6985c880a8..a572259e2e 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -738,7 +738,12 @@ class ImageStatsInputSpec(FSLCommandInputSpec): mask_file = File( exists=True, argstr="", desc='mask file used for option -k %s') index_mask_file = File( - exists=True, argstr="-K %s", position=2) + exists=True, + argstr="-K %s", + position=2, + desc="generate seperate n submasks from indexMask, " + "for indexvalues 1..n where n is the maximum index " + "value in indexMask, and generate statistics for each submask") class ImageStatsOutputSpec(TraitedSpec):