File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 5
5
import os .path as op
6
6
import nibabel as nb
7
7
import numpy as np
8
+ from distutils .version import LooseVersion
8
9
9
10
from ...utils import NUMPY_MMAP
10
11
11
12
from ... import logging
12
13
from ..base import (traits , TraitedSpec , File , isdefined )
13
- from .base import DipyBaseInterface
14
+ from .base import (HAVE_DIPY , dipy_version , dipy_to_nipype_interface ,
15
+ get_dipy_workflows , DipyBaseInterface )
14
16
15
17
IFLOGGER = logging .getLogger ('nipype.interface' )
16
18
19
+ if HAVE_DIPY and LooseVersion (dipy_version ()) >= LooseVersion ('0.15' ):
20
+ from dipy .workflows import denoise , mask
21
+
22
+ l_wkflw = get_dipy_workflows (denoise ) + get_dipy_workflows (mask )
23
+ for name , obj in l_wkflw :
24
+ new_name = name .replace ('Flow' , '' )
25
+ globals ()[new_name ] = dipy_to_nipype_interface (new_name , obj )
26
+ del l_wkflw
27
+
28
+ else :
29
+ IFLOGGER .info ("We advise you to upgrade DIPY version. This upgrade will"
30
+ " open access to more function" )
31
+
17
32
18
33
class ResampleInputSpec (TraitedSpec ):
19
34
in_file = File (
You can’t perform that action at this time.
0 commit comments