Skip to content

Commit 7cb8323

Browse files
committed
fix: get_data of integer types
1 parent 6b6f049 commit 7cb8323

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

niworkflows/interfaces/cifti.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def _create_cifti_image(bold_file, label_file, annotation_files, gii_files,
163163

164164
bold_data = bold_img.get_fdata(dtype='float32')
165165
timepoints = bold_img.shape[3]
166-
label_data = np.asanyarray(label_img._dataobj, dtype='int16')
166+
label_data = np.asanyarray(label_img.dataobj).astype('int16')
167167

168168
# set up CIFTI information
169169
series_map = ci.Cifti2MatrixIndicesMap((0, ),

niworkflows/interfaces/freesurfer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,9 @@ def _run_interface(self, runtime):
281281
msknii = nb.Nifti1Image(
282282
grow_mask(anatnii.get_fdata(dtype='float32'),
283283
np.asanyarray(
284-
nb.load(self.inputs.in_aseg)._dataobj, dtype='int16'),
284+
nb.load(self.inputs.in_aseg).dataobj).astype('int16'),
285285
np.asanyarray(
286-
nb.load(self.inputs.in_ants)._dataobj, dtype='int16')),
286+
nb.load(self.inputs.in_ants).dataobj).astype('int16')),
287287
anatnii.affine,
288288
anatnii.header
289289
)

0 commit comments

Comments
 (0)