Skip to content

Commit 9e13d6a

Browse files
committed
Cast DVARS float outputs to avoid memmap error
When the input files are not compressed, numpy wraps memmap around the dtype. This makes the traits.Float validation to fail. An more robust way would be overloading traits.Float to validate also these memmap objects. But this is probably overkilling the problem. For now, this casting is the easiest and safest solution.
1 parent 589659d commit 9e13d6a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nipype/algorithms/confounds.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ def _run_interface(self, runtime):
127127
dvars = compute_dvars(self.inputs.in_file, self.inputs.in_mask,
128128
remove_zerovariance=self.inputs.remove_zerovariance)
129129

130-
self._results['avg_std'] = dvars[0].mean()
131-
self._results['avg_nstd'] = dvars[1].mean()
132-
self._results['avg_vxstd'] = dvars[2].mean()
130+
self._results['avg_std'] = float(dvars[0].mean())
131+
self._results['avg_nstd'] = float(dvars[1].mean())
132+
self._results['avg_vxstd'] = float(dvars[2].mean())
133133

134134
tr = None
135135
if isdefined(self.inputs.series_tr):

0 commit comments

Comments
 (0)