-
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
Horrible BOLD brain mask: ds000109/sub-10 #1460
Comments
Can this kind of issue appear randomly? I don't know the details of how the brain mask is built, but maybe if there are some random seeds involved then it can manifest on rare occasions? I am asking because I have noticed that a BOLD mask has gone wrong in a very similar fasion for a single subject/run (out of a dataset containing 22 subjects, 2 runs each): However, re-running this subject with both the same (1.2.3) and newer (1.2.5) version of fmriprep produced perfect masks in both cases. Likewise, I saw no problem when processing ds000109/sub-10 (checked only on 1.2.5). Note 1: in all cases, I was running fmriprep with |
There is a little bit of randomness IIRC, but I don't know that I've seen it be more than a small shift of the border here or there. If you find a subject you can reliably reproduce the issue on, please let us know. |
Hi! I have similar issues with some subjects in a dataset I'm working on (fmriprep 1.2.5). For a few of these subjects the issues disappeared when rerunning fmriprep, however for others not. In the fmriprep report, the error appears already in the Susceptibility Distortion Correction output for some subjects, e.g.: However, for other subjects it's only apparent in the "ROIs in BOLD space" output (similar as in the screenshots posted in previous posts). Of course, the skullstripping/mask errors messes up ICA AROMA and COMPCOR completely, and sometimes also EPI to T1 registration. Strangely, these errors only occurs in one or a few runs per subject (all subjects have several runs associated). As this is still an open issue, I've made small dataset (N=2) with subjects that I could reliably reproduce the issues in. Some details about the example data: sub-02: Note that the study consisted of two sessions. MCstudy-run-01+02 and MCrest + structural T1w were collected during session 1. MCtest-run01-04 were collected during session 2. Fieldmaps were acquired in both sessions. As the subjects are part of a longitudinal study (in which this experiment represents one timepoint), all scans are however combined under the same session flag in the BIDS structure. Finally: we have fMRI data from almost 600 subjects on this task (~4200 fMRI runs), and these issues were only seen in around 25 subject, so all in all fmriprep seems to be doing a remarkable job! I'm happy to help figuring out the cause of this, but might need some input on where to look in the code. ... Ah, yes: |
Hi! Just wondering if anyone has had a chance to look at this? As mentioned I'm happy to assist, but might need a pointer about where to look. |
So this looks like a rotated mask. Can you test on the latest release (1.3.1) and verify the issue persists? There has been a PR since 1.2.5 (nipreps/niworkflows#312) that affects BOLD orientation in some edge cases. |
@markushs I'm running fmriprep 1.3.1 on your example dataset to try to narrow this down from our end as well. Hopefully, that gives us ideas on how to point you towards the right direction :) |
Thanks, that's great! I did try to run fmriprep 1.3.1 on the data on our cluster (through singularity), but it terminated immediately with somewhat similar errors as in #1534. Let me know if you need the error output to further debug that issue. EDIT: fmriprep 1.3.1.post1 seems to solve the singularity issues for me as well, btw |
@markushs I've just reproduced your issue with your data and fmriprep-1.3.1. The orientation fix did not solve this issue. |
Hi @oesteban. Seems like other people are stumbling upon this issue as well. Any ideas at this point what could be the cause? |
Hi again, I think I've maybe tracked down the problem (or at least part of it). Here's And here's The inputs to i.e: look fine in both cases. At least I can't see any obvious differences in the images across the two runs and the headers seem to match. Still, rerunning the I confirmed that this issue is present in most of our failing subjects (typically single runs in a series of runs, as explained here previously). Might be related to this reported issue: https://neurostars.org/t/fmriprep-n4biasfieldcorrection-fails/4043 |
Hi @markushs thanks a lot for the feedback. I hope I can have some bandwidth for this next week. I added your link to my dropbox so it should be safe to stop sharing the link. |
Hi, I mention this as I discovered that including |
Hi @markushs you are absolutely right. Thank you SO VERY MUCH for your perseverance and focus into detail. Would you like to submit a PR updating the corresponding code here? It would look like: n4_correct = pe.Node(ants.N4BiasFieldCorrection(
dimension=3, copy_header=True, bspline_fitting_distance=200),
name='n4_correct', n_procs=1) I would do the patch myself, but I think you deserve to take all credit for this catch. For some additional guidance you can check our docs. |
Fixed via 8f231c9 |
Potentially an Xform issue since other runs of the same subject look good.
The text was updated successfully, but these errors were encountered: