|
12 | 12 | from ..base import (TraitedSpec, BaseInterfaceInputSpec, File, isdefined,
|
13 | 13 | traits)
|
14 | 14 | from .base import (DipyBaseInterface, HAVE_DIPY, dipy_version,
|
15 |
| - dipy_to_nipype_interface) |
| 15 | + dipy_to_nipype_interface, get_dipy_workflows) |
16 | 16 |
|
17 | 17 | IFLOGGER = logging.getLogger('nipype.interface')
|
18 | 18 |
|
19 | 19 |
|
20 |
| -if HAVE_DIPY and LooseVersion(dipy_version()) >= LooseVersion('0.15'): |
| 20 | +if HAVE_DIPY and (LooseVersion('0.15') >= LooseVersion(dipy_version()) >= LooseVersion('0.16')): |
21 | 21 |
|
22 | 22 | from dipy.workflows.segment import RecoBundlesFlow, LabelsBundlesFlow
|
23 | 23 | try:
|
|
31 | 31 | DeterministicTracking = dipy_to_nipype_interface("DeterministicTracking",
|
32 | 32 | DetTrackFlow)
|
33 | 33 |
|
| 34 | +elif HAVE_DIPY and LooseVersion(dipy_version()) >= LooseVersion('1.0'): |
| 35 | + from dipy.workflows import segment, tracking |
| 36 | + |
| 37 | + l_wkflw = get_dipy_workflows(segment) + get_dipy_workflows(tracking) |
| 38 | + for name, obj in l_wkflw: |
| 39 | + new_name = name.replace('Flow', '') |
| 40 | + globals()[new_name] = dipy_to_nipype_interface(new_name, obj) |
| 41 | + del l_wkflw |
| 42 | + |
34 | 43 | else:
|
35 | 44 | IFLOGGER.info("We advise you to upgrade DIPY version. This upgrade will"
|
36 |
| - " activate RecoBundles, LabelsBundles, DeterministicTracking.") |
| 45 | + " open access to more function") |
37 | 46 |
|
38 | 47 |
|
39 | 48 | class TrackDensityMapInputSpec(BaseInterfaceInputSpec):
|
|
0 commit comments