-
Notifications
You must be signed in to change notification settings - Fork 296
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
aCompcor ROI Mask - GM Voxels #3195
Comments
Hi @demidenm, Thank you for this report. |
@julfou81 - Thanks for the note. Yes, the delineation of the CSF/WM/GM boundary seems reasonable (Left, above). However, I suspect it may contain excessively overlapping boundaries as a result of either fast segmentation or the fuzziness applied? The contours in the above are a visually over represented by the magenta color. Every instance of this type of delineation results in a poor acompcor ROI (In 1000+ fmriprep outputs, I have observed 50-60 of these). The other image (Right, above) I provided is the Brain mask and (anatomical/temporal) CompCor ROIs masks overlayed on the reference image. Specifically, the red = BOLD image mask, magenta = anatomical CompCor ROI, blue = temporal ComCor ROI and green = brain edge crown. Note, when the freesurfer Brain mask and brain tissue segmentation of the T1w looks like the below, the aCompcor ROI oddity does not occur and it is relatively normal. UPDATE: touch base with @effigies and it seems like it is a FAST segmentation failure as the labels are incorrect. See example: Blue is labeled as rec-normalized_label-GM_probseg, Green is rec-normalized_label-CSF_probseg and Red is rec-normalized_label-WM_probseg |
@oesteban If you have a second, have you seen this GM/CSF swap before? Is there a good way to detect? I suppose we could take total volumes and sort those to check for plausible ordering WM > GM > CSF... |
It is a very interesting case. From what I just read it seems that the origin of the issue is a segmentation failure from FSL FAST? It looks like the underlying T1w image in the case where the FAST segmentation fails (in your first post) has a very different contrast (the WM look much brighter) than in your second case where the segmentation looks good. FAST is not using tissue priors and only relies on images intensity distribution. Do you think that for all the cases where aCompCor (and FAST) failed, there was an odd intensity distribution in the input T1w images? |
@julfou81 - Thanks for the note. I conducted the sanity check on one of the subjects that clearly has this mix-up. Taking the *T1w.nii.gz image, I ran the following steps. Consistent with the pve_[0:2] outputs (0=CSF, 1=GM, and 2=WM), the segmentation seemed to have worked correctly. Based on the above thesis, pve_0 and pve_1 would be flipped but in this instance they do not appear to be. |
That was a good test. What you could do now is to navigate through the working directory for this subject look into:
And look at how the |
@julfou81 - thanks for note. Unfortunately the working dir was ran in tmp scratch so it isn't easily available. Nevertheless, I will try to rerun soon and extend hold on the fmriprep working dir to check. |
@julfou81 - Had a change to rerun it and inspect the ./wd/ closer. Looking at the command, the command differs a touch (e.g. uses Here is fmriprep command.txt: I went ahead and compared the results using ./fp/ ./orig/ |
Thank you @demidenm for this thorough analysis! It is very interesting and it is the first time that I see such a strange behavior of A good point is that you are able to reproduce this strange behavior calling 'FAST' outside of fmriprep with the same input.
|
@julfou81 - thanks for the note & suggestion! Will see if @oesteban @effigies arrive at a solution but the adding into the pipeline some kind of subject prep to avoid this may be helpful. TBH, I'm not quite sure what that may be. In the meantime, for my purposes, a non-elegant way to flag this issue may be to run bet+fast on the uncorrected T1w and estimate the dice(GM-uncorrected,fmriprep GM-corrected). Bad ones would be approx <.50 |
I wanted to follow up on this issue, as this happened to some of our subjects with FMRIPREP v24.0.0. I take back what I just said above, this wrong behavior in FMRIPREP for the creation of the aCompCor masks is not linked to wether or not we use the |
@julfou81 - This is interesting. Wonder what is up with the ABCD study data as rerunning didnt really resolve this problem for me :( |
Hey @pauldmccarthy, I wonder if you could have a look at this thread. In particular #3195 (comment) shows FAST sometimes mislabeling CSF and GM. I'm curious if there's something we can do to either detect this or parametrize FAST to avoid it. |
Hi @effigies, I have seen instances of FAST failing on images where there is not enough variance in one or more of the tissue classes for it to be able to model the distribution of values within each class. Based on the screenshots in #3195 (comment), I'm guessing that this is what is happening here - the different tissue classes are too uniform for FAST to be able to accurately model them. FAST is also sensitive to NaNs or non-zero values in non-brain regions, although I'm not sure if that's relevant here. There are a few relevant posts on the FSL mailing list:
I'm not familiar enough with fmriprep to know whether it is possible to pass What kind of normalisation/rescaling is being applied? If you can roughly predict the mean intensity of each tissue class, you could pass these values as priors to I'm happy to play around if you could point me to an image which causes the failure. |
Here is our T1w template workflow: That's actually the 1-image variant of the workflow. Here's for 2+: We denoise (Rician, I think) the images first. If there are multiple we bias-field correct, and then merge with Freesurfer's It seems likely to be the |
I want to share a new observation I made. I still can't wrap my head around it: I tried very hard to obtain these wrong aCompCor masks with fmriprep v24.0.0 on a single subject where I saw wrong masks once (but didn't save the working directory).
(in my case I was rerunning fmriprep because I was fighting another bug: antsAI failing during the N4 correction of the bold images for skullstripping, similar to what was described here, but with no issue on coregistration: #3163) Every time I relaunched the fmriprep execution after deleting both the working directory and the output directory, the aCompcor masks were good. I also took the input of |
What happened?
aCompCor mask may include gray mask voxels for some participants. It appears the procedure "a mask of pixels that likely contain a volume fraction of GM is subtracted from the aCompCor masks. This mask is obtained by dilating a GM mask extracted from the FreeSurfer aseg segmentation, and it ensures components are not extracted from voxels containing a minimal fraction of GM. Finally, these masks are resampled into BOLD space and binarized by thresholding at 0.99" doesn't work in all cases, esp. the dataset I am working with as rate is at least 1/10 or 1/15 where this occurs.
What command did you use?
What version of fMRIPrep are you running?
23.1.4
How are you running fMRIPrep?
Singularity
Is your data BIDS valid?
Yes
Are you reusing any previously computed results?
No
Please copy and paste any relevant log output.
No response
Additional information / screenshots
Including screen shot of freesurfer WM/GM/CSF contours and the image where acompcor ROI mask using for acompcor.
The text was updated successfully, but these errors were encountered: