From 313801b7a75cad23485a1237a2b5509bf524c356 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Mon, 3 Feb 2025 09:08:37 -0500 Subject: [PATCH] Fix spelling errors in code (#488) --- aslprep/utils/asl.py | 2 +- aslprep/utils/cbf.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/aslprep/utils/asl.py b/aslprep/utils/asl.py index 198829e77..15a7d97a0 100644 --- a/aslprep/utils/asl.py +++ b/aslprep/utils/asl.py @@ -33,7 +33,7 @@ def determine_multi_pld(metadata): Returns ------- :obj:`bool` - True if the data are multi-delay/TI. Fale if not. + True if the data are multi-delay/TI. False if not. """ plds = np.array(metadata['PostLabelingDelay']) return np.unique(plds).size > 1 diff --git a/aslprep/utils/cbf.py b/aslprep/utils/cbf.py index 3545be7c3..501d53b4d 100644 --- a/aslprep/utils/cbf.py +++ b/aslprep/utils/cbf.py @@ -302,8 +302,8 @@ def _getcbfscore(cbfts, wm, gm, csf, mask, thresh=0.7): # robust mean and median median_gm_cbf = np.median(gm_cbf_ts) mad_gm_cbf = median_abs_deviation(gm_cbf_ts) / 0.675 - indx = 1 * (np.abs(gm_cbf_ts - median_gm_cbf) > (2.5 * mad_gm_cbf)) - R = np.mean(cbfts[:, :, :, indx == 0], axis=3) + index = 1 * (np.abs(gm_cbf_ts - median_gm_cbf) > (2.5 * mad_gm_cbf)) + R = np.mean(cbfts[:, :, :, index == 0], axis=3) V = ( n_gm_voxels * np.var(R[gm == 1]) + n_wm_voxels * np.var(R[wm == 1]) @@ -314,29 +314,29 @@ def _getcbfscore(cbfts, wm, gm, csf, mask, thresh=0.7): V1 = V CC = np.zeros(cbfts.shape[3]) * (-2) for s in range(cbfts.shape[3]): - if indx[s] != 0: + if index[s] != 0: break else: tmp1 = cbfts[:, :, :, s] CC[s] = np.corrcoef(R[mask1 > 0], tmp1[mask1 > 0])[0][1] inx = np.argmax(CC) - indx[inx] = 2 - R = np.mean(cbfts[:, :, :, indx == 0], axis=3) + index[inx] = 2 + R = np.mean(cbfts[:, :, :, index == 0], axis=3) V = ( (n_gm_voxels * np.var(R[gm == 1])) + (n_wm_voxels * np.var(R[wm == 1])) + (n_csf_voxels * np.var(R[csf == 1])) ) - config.loggers.utils.warning(f'SCORE retains {np.sum(indx == 0)}/{indx.size} volumes') - cbfts_recon = cbfts[:, :, :, indx == 0] + config.loggers.utils.warning(f'SCORE retains {np.sum(index == 0)}/{index.size} volumes') + cbfts_recon = cbfts[:, :, :, index == 0] cbfts_recon1 = np.zeros_like(cbfts_recon) for i in range(cbfts_recon.shape[3]): cbfts_recon1[:, :, :, i] = cbfts_recon[:, :, :, i] * mask cbfts_recon1 = np.nan_to_num(cbfts_recon1) - return cbfts_recon1, indx + return cbfts_recon1, index def _robust_fit(