@@ -56,19 +56,19 @@ class _BSplineApproxInputSpec(BaseInterfaceInputSpec):
5656 in_data = File (exists = True , mandatory = True , desc = "path to a fieldmap" )
5757 in_mask = File (exists = True , desc = "path to a brain mask" )
5858 bs_spacing = InputMultiObject (
59- [DEFAULT_ZOOMS_MM ],
59+ [DEFAULT_HF_ZOOMS_MM ],
6060 traits .Tuple (traits .Float , traits .Float , traits .Float ),
6161 usedefault = True ,
6262 desc = "spacing between B-Spline control points" ,
6363 )
6464 ridge_alpha = traits .Float (
65- 0.01 , usedefault = True , desc = "controls the regularization"
65+ 1e-4 , usedefault = True , desc = "controls the regularization"
6666 )
6767 recenter = traits .Enum (
68+ False ,
6869 "mode" ,
6970 "median" ,
7071 "mean" ,
71- False ,
7272 usedefault = True ,
7373 desc = "strategy to recenter the distribution of the input fieldmap" ,
7474 )
@@ -80,7 +80,7 @@ class _BSplineApproxInputSpec(BaseInterfaceInputSpec):
8080 zooms_min = traits .Union (
8181 traits .Float ,
8282 traits .Tuple (traits .Float , traits .Float , traits .Float ),
83- default_value = 4 .0 ,
83+ default_value = 1 .0 ,
8484 usedefault = True ,
8585 desc = "limit minimum image zooms, set 0.0 to use the original image" ,
8686 )
@@ -211,9 +211,7 @@ def _run_interface(self, runtime):
211211 )
212212
213213 # 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 )
217215 for attempt in range (3 ):
218216 model .fit (colmat , data .reshape (- 1 ))
219217 extreme = np .abs (model .coef_ ).max ()
@@ -228,6 +226,8 @@ def _run_interface(self, runtime):
228226 f"Extreme value { extreme :.2e} detected in spline coefficients."
229227 )
230228
229+ LOGGER .info (f"Model fit. Intercept = { model .intercept_ } " )
230+
231231 # Store coefficients
232232 index = 0
233233 self ._results ["out_coeff" ] = []
0 commit comments