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

Give more details when the images cannot be denoised with scrubbing strategy #147

Open
htwangtw opened this issue May 23, 2024 · 0 comments

Comments

@htwangtw
Copy link
Collaborator

Your idea

When using the scrubbing strategy, the code will check if the number of remaining volumes is smaller than number of regressors before denoisine. This is a constrain of temporal degrees of freedom - if the number of regressors is greater than the number of volumes, it's not possilbe to run a linear regression.
The error message should explain why there's not enough frame.

def _check_exclusion(
reduced_confounds: pd.DataFrame,
sample_mask: np.ndarray[Any, Any] | None,
) -> bool:
"""For scrubbing based strategy, check if regression can be performed."""
if sample_mask is not None:
kept_vol = len(sample_mask)
else:
kept_vol = reduced_confounds.shape[0]
# if more noise regressors than volume, this data is not denoisable
remove = kept_vol < reduced_confounds.shape[1]
return remove

@htwangtw htwangtw added this to the Next update milestone Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant