Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spelling errors in code #488

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aslprep/utils/asl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions aslprep/utils/cbf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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(
Expand Down
Loading