From 472b7e8505962bf9a3ce908371dd9482bccdb72d Mon Sep 17 00:00:00 2001 From: Steven Tilley Date: Tue, 13 Aug 2019 16:37:58 -0400 Subject: [PATCH 1/3] [FIX] check for existance of NULL file --- nipype/interfaces/ants/registration.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nipype/interfaces/ants/registration.py b/nipype/interfaces/ants/registration.py index c08c7646a9..f32a7fe376 100644 --- a/nipype/interfaces/ants/registration.py +++ b/nipype/interfaces/ants/registration.py @@ -923,7 +923,6 @@ class Registration(ANTSCommand): DEF_SAMPLING_STRATEGY = 'None' """The default sampling strategy argument.""" - _cmd = 'antsRegistration' input_spec = RegistrationInputSpec output_spec = RegistrationOutputSpec _quantilesDone = False @@ -1099,6 +1098,14 @@ def _format_registration(self): if len(moving_masks) > 1 else 0] else: moving_mask = 'NULL' + if (fixed_mask == 'NULL' or + isinstance(fixed_mask, list) and 'NULL' in fixed_mask or + moving_mask == 'NULL' or + isinstance(moving_mask, list) and 'NULL' in moving_mask): + print("CURRENT PATH: {}".format(os.getcwd())) + if os.path.exists('NULL'): + raise RuntimeError('NULL used as placeholder for no mask ' + 'but a file named NULL exists') retval.append('--masks [ %s, %s ]' % (fixed_mask, moving_mask)) return " ".join(retval) From 1931f6bf5467643b4bb5851201ec7c5498e43dfc Mon Sep 17 00:00:00 2001 From: Steven Tilley Date: Tue, 13 Aug 2019 16:42:22 -0400 Subject: [PATCH 2/3] add Steven Tilley --- .zenodo.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.zenodo.json b/.zenodo.json index a7333e6ec4..8fff817975 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -676,6 +676,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": [ From 411defe8408a15effdc9c4e573b6e482bfa06faf Mon Sep 17 00:00:00 2001 From: Steven Tilley Date: Tue, 13 Aug 2019 17:39:38 -0400 Subject: [PATCH 3/3] Bugfix. fix regression bug from 472b7e85 --- nipype/interfaces/ants/registration.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nipype/interfaces/ants/registration.py b/nipype/interfaces/ants/registration.py index f32a7fe376..9785b15954 100644 --- a/nipype/interfaces/ants/registration.py +++ b/nipype/interfaces/ants/registration.py @@ -923,6 +923,7 @@ class Registration(ANTSCommand): DEF_SAMPLING_STRATEGY = 'None' """The default sampling strategy argument.""" + _cmd = 'antsRegistration' input_spec = RegistrationInputSpec output_spec = RegistrationOutputSpec _quantilesDone = False