Skip to content

Commit f6bf0af

Browse files
committed
FIX: Add dtypes to nilearn interface/tests
1 parent f20035c commit f6bf0af

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

nipype/interfaces/nilearn.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def _process_inputs(self):
155155
if self.inputs.include_global:
156156
global_label_data = label_data.dataobj.sum(axis=3) # sum across all regions
157157
global_label_data = (
158-
np.rint(global_label_data).astype(int).clip(0, 1)
158+
np.rint(global_label_data).clip(0, 1).astype('u1')
159159
) # binarize
160160
global_label_data = self._4d(global_label_data, label_data.affine)
161161
global_masker = nl.NiftiLabelsMasker(

nipype/interfaces/tests/test_nilearn.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,11 @@ def assert_expected_output(self, labels, wanted):
184184
[[2, -2, -1, -2, -5], [3, 0, 3, -5, -2]],
185185
[[-4, -2, -2, 1, -2], [3, 1, 4, -3, -2]],
186186
],
187-
]
187+
],
188+
np.int16,
188189
)
189190

190-
fake_label_data = np.array([[[1, 0], [3, 1]], [[2, 0], [1, 3]]])
191+
fake_label_data = np.array([[[1, 0], [3, 1]], [[2, 0], [1, 3]]], np.uint8)
191192

192193
fake_equiv_4d_label_data = np.array(
193194
[

0 commit comments

Comments
 (0)