From 31482d4d4ce77ac5c9b941de40a67de0870a5e5c Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Wed, 10 Oct 2018 00:15:50 -0400 Subject: [PATCH 1/2] enh: turn interface into callable --- nipype/interfaces/base/core.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nipype/interfaces/base/core.py b/nipype/interfaces/base/core.py index 31ae82be52..14e4f94f2f 100644 --- a/nipype/interfaces/base/core.py +++ b/nipype/interfaces/base/core.py @@ -587,6 +587,11 @@ def run(self, cwd=None, ignore_exception=None, **inputs): return results + def __call__(self, **kwargs): + """Make interface into a callable function""" + results = self.run(**kwargs) + return results.outputs + def _list_outputs(self): """ List the expected outputs """ From 3d347adba2f406241f8379ee5eb8c751bc8d1f88 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Thu, 25 Oct 2018 14:21:55 -0400 Subject: [PATCH 2/2] Update nipype/interfaces/base/core.py --- nipype/interfaces/base/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/interfaces/base/core.py b/nipype/interfaces/base/core.py index 14e4f94f2f..8fededa899 100644 --- a/nipype/interfaces/base/core.py +++ b/nipype/interfaces/base/core.py @@ -590,7 +590,7 @@ def run(self, cwd=None, ignore_exception=None, **inputs): def __call__(self, **kwargs): """Make interface into a callable function""" results = self.run(**kwargs) - return results.outputs + return results def _list_outputs(self): """ List the expected outputs