|
18 | 18 | from ... import logging |
19 | 19 | from ..base import TraitedSpec, File, traits, isdefined |
20 | 20 | from .base import (DipyDiffusionInterface, DipyBaseInterfaceInputSpec, |
21 | | - HAVE_DIPY, dipy_version, dipy_to_nipype_interface) |
| 21 | + HAVE_DIPY, dipy_version, dipy_to_nipype_interface, |
| 22 | + get_dipy_workflows) |
22 | 23 |
|
23 | 24 |
|
24 | 25 | IFLOGGER = logging.getLogger('nipype.interface') |
25 | 26 |
|
26 | | -if HAVE_DIPY and LooseVersion(dipy_version()) >= LooseVersion('0.15'): |
| 27 | +if HAVE_DIPY and (LooseVersion('0.15') >= LooseVersion(dipy_version()) >= LooseVersion('0.16')): |
27 | 28 | from dipy.workflows.reconst import (ReconstDkiFlow, ReconstCSAFlow, |
28 | 29 | ReconstCSDFlow, ReconstMAPMRIFlow, |
29 | 30 | ReconstDtiFlow) |
|
33 | 34 | DTIModel = dipy_to_nipype_interface("DTIModel", ReconstDtiFlow) |
34 | 35 | CSAModel = dipy_to_nipype_interface("CSAModel", ReconstCSAFlow) |
35 | 36 | CSDModel = dipy_to_nipype_interface("CSDModel", ReconstCSDFlow) |
| 37 | + |
| 38 | +elif HAVE_DIPY and LooseVersion(dipy_version()) >= LooseVersion('1.0'): |
| 39 | + from dipy.workflows import reconst |
| 40 | + |
| 41 | + l_wkflw = get_dipy_workflows(reconst) |
| 42 | + for name, obj in l_wkflw: |
| 43 | + new_name = name.replace('Flow', '') |
| 44 | + globals()[new_name] = dipy_to_nipype_interface(new_name, obj) |
| 45 | + del l_wkflw |
| 46 | + |
36 | 47 | else: |
37 | 48 | IFLOGGER.info("We advise you to upgrade DIPY version. This upgrade will" |
38 | | - " activate DKIModel, MapmriModel, DTIModel, CSAModel, CSDModel.") |
| 49 | + " open access to more models") |
39 | 50 |
|
40 | 51 |
|
41 | 52 | class RESTOREInputSpec(DipyBaseInterfaceInputSpec): |
|
0 commit comments