-
Notifications
You must be signed in to change notification settings - Fork 95
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
Create a CLI option that allows for user-defined mask instead of adaptive_mask for denoising #862
Comments
Hi @CesarCaballeroGaudes, the denoising process requires a minimum of 3 echoes to calculate the metrics we use, so the limit is in place to avoid introducing errors or subtle bugs. The only way we could get denoising with fewer echoes is to add a new method which requires fewer echoes, at which point we could have a step-dependent mask. |
I agree. I was suggesting that the denoising is applied to the voxels within the mask defined by the user, but the rest of the process and the classification can be done with the mask that requires a minimum of 3 echoes. I think it could add some flexibility. |
I believe the changes I made for a paper I'm working on (in #837) essentially do that. |
This request seems to be a special case for a potentially more useful parameter. Right now, the adaptive mask is calculated in ./tedana/utils.py/make_adaptive_mask: Lines 79 to 86 in 65e8ddf
In that code, we have two hard-coded values:
This is a fairly conservative masking approach, but I can see reasons why people would want to adjust the threshold. Maybe they want to keep a bit more of the dropout region or maybe they want to more aggressively restrict the mask to voxels with minimal dropout. My proposal would be:
Thoughts? |
Thanks @tsalo for the code. Indeed, it does what we intended to do. I like @handwerkerd 's suggestions, particularly the |
After a couple of hours looking through the code we realized that our issue was not in the creation of the adaptive mask, but on the mask that nilearn creates with We don't have any issues when we provide our own mask with Re implementing user-defined percentile and threshold: do tedana devs think this would be useful for users? |
I would much rather users with the need to fine tune a mask simply pass their own mask. |
@eurunuela Just to clarify, are you saying that this issue is resolved if you use the existing I do think there's a benefit to allowing a user-defined mask because a user might want to set extra criteria that we don't want to have to deal with. For example, they might want to create a mask using a higher resolution anatomical image to make sure all fMRI voxels, not only have signal, but are within the brain. The automask in nilearn, should be good at this type of thing, but not as good as using a high res anatomical. |
That seems to be the case for us. We only tested on one session, but I'll know about the rest of the dataset tomorrow. Happy to move the discussion re flexibility to #837. I also wonder if @tsalo used |
@eurunuela I used the fMRIPrep brain mask. The problem in my case was that CSF and WM don't have enough good echoes to be retained in the denoising mask (they obviously shouldn't be included in the classification mask), which made then doing aCompCor on the denoised data impossible. Basically, both |
I forgot to update you on this. We ended up using the Going to close the issue. |
Summary
Create a CLI option that allows to use a user-defined mask for denoising purposes instead of using the default adaptive mask.
Additional Detail
We are observing that the adaptive mask does not include the subcortical regions in multiple datasets but in some cases the user might want to still denoise these voxels, and prefer to use their own mask (previously computed).
Next Steps
A possible solution could be adding a CLI option that does not apply the adaptive mask for denoising, e.g.
-use_mask_denoising
, and create an IF statement after the computation of the adaptive mask (maybe report a warning) and the mask used for classification so thatmask_denoise
is set to the mask provided by the user.For instance, the IF statement could be here
The text was updated successfully, but these errors were encountered: