Skip to content

Commit 81167ca

Browse files
committed
cleaner reading
1 parent 756088a commit 81167ca

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

nipype/algorithms/stats.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,10 @@ class ACM(SimpleInterface):
4343
def _run_interface(self, runtime):
4444
allmaps = nb.concat_images(
4545
[nb.load(f) for f in self.inputs.in_files]).get_data()
46-
acm_pos = (allmaps > self.inputs.threshold).astype(
47-
float).mean(3)
48-
acm_neg = (allmaps < -1.0 * self.inputs.threshold).astype(
49-
float).mean(3)
50-
46+
acm_pos = np.mean(allmaps > self.inputs.threshold,
47+
axis=3, dtype=np.float32)
48+
acm_neg = np.mean(allmaps < -1.0 * self.inputs.threshold,
49+
axis=3, dtype=np.float32)
5150
acm_diff = acm_pos - acm_neg
5251

5352
nii = nb.load(self.inputs.in_files[0])

0 commit comments

Comments
 (0)