Skip to content

Commit 6b8bdb4

Browse files
committed
fix: np.zeros now only takes integers
1 parent e8e8d15 commit 6b8bdb4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

nipype/algorithms/misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ def split_rois(in_file, mask=None, roishape=None):
12711271
np.savez(iname, (nzels[0][first:last],))
12721272

12731273
if fill > 0:
1274-
droi = np.vstack((droi, np.zeros((fill, nvols), dtype=np.float32)))
1274+
droi = np.vstack((droi, np.zeros(int(fill, nvols), dtype=np.float32)))
12751275
partialmsk = np.ones((roisize,), dtype=np.uint8)
12761276
partialmsk[-fill:] = 0
12771277
partname = op.abspath('partialmask.nii.gz')

nipype/algorithms/modelgen.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,12 +655,12 @@ def _gen_regress(self, i_onsets, i_durations, i_amplitudes, nscans):
655655
hrf = spm_hrf(dt * 1e-3)
656656
reg_scale = 1.0
657657
if self.inputs.scale_regressors:
658-
boxcar = np.zeros((50.0 * 1e3 / dt))
658+
boxcar = np.zeros(int(50.0 * 1e3 / dt))
659659
if self.inputs.stimuli_as_impulses:
660-
boxcar[1.0 * 1e3 / dt] = 1.0
660+
boxcar[int(1.0 * 1e3 / dt)] = 1.0
661661
reg_scale = float(TA / dt)
662662
else:
663-
boxcar[(1.0 * 1e3 / dt):(2.0 * 1e3 / dt)] = 1.0
663+
boxcar[int(1.0 * 1e3 / dt):int(2.0 * 1e3 / dt)] = 1.0
664664
if isdefined(self.inputs.model_hrf) and self.inputs.model_hrf:
665665
response = np.convolve(boxcar, hrf)
666666
reg_scale = 1.0 / response.max()

0 commit comments

Comments
 (0)