@@ -56,19 +56,19 @@ class _BSplineApproxInputSpec(BaseInterfaceInputSpec):
56
56
in_data = File (exists = True , mandatory = True , desc = "path to a fieldmap" )
57
57
in_mask = File (exists = True , desc = "path to a brain mask" )
58
58
bs_spacing = InputMultiObject (
59
- [DEFAULT_ZOOMS_MM ],
59
+ [DEFAULT_HF_ZOOMS_MM ],
60
60
traits .Tuple (traits .Float , traits .Float , traits .Float ),
61
61
usedefault = True ,
62
62
desc = "spacing between B-Spline control points" ,
63
63
)
64
64
ridge_alpha = traits .Float (
65
- 0.01 , usedefault = True , desc = "controls the regularization"
65
+ 1e-4 , usedefault = True , desc = "controls the regularization"
66
66
)
67
67
recenter = traits .Enum (
68
+ False ,
68
69
"mode" ,
69
70
"median" ,
70
71
"mean" ,
71
- False ,
72
72
usedefault = True ,
73
73
desc = "strategy to recenter the distribution of the input fieldmap" ,
74
74
)
@@ -80,7 +80,7 @@ class _BSplineApproxInputSpec(BaseInterfaceInputSpec):
80
80
zooms_min = traits .Union (
81
81
traits .Float ,
82
82
traits .Tuple (traits .Float , traits .Float , traits .Float ),
83
- default_value = 4 .0 ,
83
+ default_value = 1 .0 ,
84
84
usedefault = True ,
85
85
desc = "limit minimum image zooms, set 0.0 to use the original image" ,
86
86
)
@@ -211,9 +211,7 @@ def _run_interface(self, runtime):
211
211
)
212
212
213
213
# Fit the model
214
- model = lm .Ridge (
215
- alpha = self .inputs .ridge_alpha , fit_intercept = False , solver = "lsqr"
216
- )
214
+ model = lm .Ridge (alpha = self .inputs .ridge_alpha , fit_intercept = True )
217
215
for attempt in range (3 ):
218
216
model .fit (colmat , data .reshape (- 1 ))
219
217
extreme = np .abs (model .coef_ ).max ()
@@ -228,6 +226,8 @@ def _run_interface(self, runtime):
228
226
f"Extreme value { extreme :.2e} detected in spline coefficients."
229
227
)
230
228
229
+ LOGGER .info (f"Model fit. Intercept = { model .intercept_ } " )
230
+
231
231
# Store coefficients
232
232
index = 0
233
233
self ._results ["out_coeff" ] = []
0 commit comments