1616
1717IFLOGGER = logging .getLogger ('interface' )
1818
19+
1920class APMQballInputSpec (DipyBaseInterfaceInputSpec ):
2021 mask_file = File (exists = True ,
2122 desc = 'An optional brain mask' )
@@ -24,6 +25,7 @@ class APMQballInputSpec(DipyBaseInterfaceInputSpec):
2425class APMQballOutputSpec (TraitedSpec ):
2526 out_file = File (exists = True )
2627
28+
2729class APMQball (DipyDiffusionInterface ):
2830 """
2931 Calculates the anisotropic power map
@@ -43,9 +45,8 @@ class APMQball(DipyDiffusionInterface):
4345
4446 def _run_interface (self , runtime ):
4547 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
4950
5051 gtab = self ._get_gradient_table ()
5152
@@ -58,15 +59,13 @@ def _run_interface(self, runtime):
5859
5960 # Fit it
6061 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 )
6464 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 )
6767 IFLOGGER .info ('APM qball image saved as {i}' .format (i = out_file ))
6868
69-
7069 return runtime
7170
7271 def _list_outputs (self ):
0 commit comments