Skip to content

Commit d6ae63d

Browse files
committed
FIX: Select regress_poly output
1 parent 1577220 commit d6ae63d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

nipype/algorithms/confounds.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def _process_masks(self, mask_images, timeseries=None):
543543
for i, img in enumerate(mask_images):
544544
mask = img.get_data().astype(np.bool)
545545
imgseries = timeseries[mask, :]
546-
imgseries = regress_poly(2, imgseries)
546+
imgseries = regress_poly(2, imgseries)[0]
547547
tSTD = _compute_tSTD(imgseries, 0, axis=-1)
548548
threshold_std = np.percentile(tSTD, np.round(100. *
549549
(1. - self.inputs.percentile_threshold)).astype(int))
@@ -618,7 +618,7 @@ def _run_interface(self, runtime):
618618
data = data.astype(np.float32)
619619

620620
if isdefined(self.inputs.regress_poly):
621-
data = regress_poly(self.inputs.regress_poly, data, remove_mean=False)
621+
data = regress_poly(self.inputs.regress_poly, data, remove_mean=False)[0]
622622
img = nb.Nifti1Image(data, img.affine, header)
623623
nb.save(img, op.abspath(self.inputs.detrended_file))
624624

@@ -734,9 +734,10 @@ def compute_dvars(in_file, in_mask, remove_zerovariance=False,
734734
func_sd = func_sd[func_sd != 0]
735735

736736
# Compute (non-robust) estimate of lag-1 autocorrelation
737-
ar1 = np.apply_along_axis(AR_est_YW, 1,
738-
regress_poly(0, mfunc, remove_mean=True).astype(
739-
np.float32), 1)[:, 0]
737+
ar1 = np.apply_along_axis(
738+
AR_est_YW, 1,
739+
regress_poly(0, mfunc, remove_mean=True)[0].astype(np.float32),
740+
1)[:, 0]
740741

741742
# Compute (predicted) standard deviation of temporal difference time series
742743
diff_sdhat = np.squeeze(np.sqrt(((1 - ar1) * 2).tolist())) * func_sd

0 commit comments

Comments
 (0)