Skip to content

Commit a854869

Browse files
committed
add get_dipy_workflows function
1 parent 27dc5cb commit a854869

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

nipype/interfaces/dipy/base.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,29 @@ def _list_outputs(self):
211211
"_run_interface": _run_interface,
212212
"_list_outputs:": _list_outputs})
213213
return newclass
214+
215+
216+
def get_dipy_workflows(module):
217+
"""Search for DIPY workflow class.
218+
219+
Parameters
220+
----------
221+
module : object
222+
module object
223+
224+
Returns
225+
-------
226+
l_wkflw : list of tuple
227+
This a list of tuple containing 2 elements:
228+
Worflow name, Workflow class obj
229+
230+
Examples
231+
--------
232+
>>> from dipy.workflows import align
233+
>>> get_dipy_workflows(align)
234+
235+
"""
236+
return [(m, obj) for m, obj in inspect.getmembers(module)
237+
if inspect.isclass(obj) and
238+
issubclass(obj, module.Workflow) and
239+
m not in ['Workflow', 'CombinedWorkflow']]

0 commit comments

Comments
 (0)