16
16
17
17
IFLOGGER = logging .getLogger ('interface' )
18
18
19
+
19
20
class APMQballInputSpec (DipyBaseInterfaceInputSpec ):
20
21
mask_file = File (exists = True ,
21
22
desc = 'An optional brain mask' )
@@ -24,6 +25,7 @@ class APMQballInputSpec(DipyBaseInterfaceInputSpec):
24
25
class APMQballOutputSpec (TraitedSpec ):
25
26
out_file = File (exists = True )
26
27
28
+
27
29
class APMQball (DipyDiffusionInterface ):
28
30
"""
29
31
Calculates the anisotropic power map
@@ -43,9 +45,8 @@ class APMQball(DipyDiffusionInterface):
43
45
44
46
def _run_interface (self , runtime ):
45
47
from dipy .reconst import shm
46
- from dipy .io .utils import nifti1_symmat
47
- from dipy .data import get_sphere
48
- from dipy .reconst .peaks import peaks_from_model
48
+ from dipy .data import get_sphere
49
+ from dipy .reconst .peaks import peaks_from_model
49
50
50
51
gtab = self ._get_gradient_table ()
51
52
@@ -58,15 +59,13 @@ def _run_interface(self, runtime):
58
59
59
60
# Fit it
60
61
model = shm .QballModel (gtab ,8 )
61
- sphere = get_sphere ('symmetric724' )
62
- fit = model .fit (data , mask )
63
- peaks = peaks_from_model (model = model , data = data , relative_peak_threshold = .5 , min_separation_angle = 25 , sphere = sphere , mask = mask )
62
+ sphere = get_sphere ('symmetric724' )
63
+ peaks = peaks_from_model (model = model , data = data , relative_peak_threshold = .5 , min_separation_angle = 25 , sphere = sphere , mask = mask )
64
64
apm = shm .anisotropic_power (peaks .shm_coeff )
65
- out_file = self ._gen_filename ('apm' )
66
- nb .Nifti1Image (apm .astype ("float32" ), affine ).to_filename (out_file )
65
+ out_file = self ._gen_filename ('apm' )
66
+ nb .Nifti1Image (apm .astype ("float32" ), affine ).to_filename (out_file )
67
67
IFLOGGER .info ('APM qball image saved as {i}' .format (i = out_file ))
68
68
69
-
70
69
return runtime
71
70
72
71
def _list_outputs (self ):
0 commit comments