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

Regression: Brain mask and brain tissue segmentation of the T1w worsened from 20.1.3 to 20.2.0-LTS #230

Open
mathias-sm opened this issue Oct 27, 2020 · 9 comments
Labels
effort:high Estimated high effort task impact:medium Estimated medium impact task mp2rage problems derived from multi-echo T1w images skull-stripping Brain extraction problems

Comments

@mathias-sm
Copy link

What version of fMRIPrep are you using?

Tested with all releases from 20.1.1 to 20.2.0-LTS

What kind of installation are you using? Containers (Singularity, Docker), or "bare-metal"?

Singularity containers

What is the exact command-line you used?

singularity run --cleanenv -B /path:/path fmriprep-singularity-<version> bids_dataset output_<version> participant --fs-no-reconall --fs-license-file license.txt --participant_label 1003 --output-spaces MNI152NLin2009cAsym:res-native --anat-only -w tmp/work<version> --nprocs 4 > tmp/<version> 2> tmp/<version>

Where <version> ranged from 20.1.1 to 20.2.0 LTS including the release candidates

Have you checked that your inputs are BIDS valid?

Yes, with bids-validator v1.5.3

Did fMRIPrep generate the visual report for this particular subject? If yes, could you share it?

Yes, I'm sending the reports to [email protected] and put at the bottom of this issue screenshots of the issue.

Can you find some traces of the error reported in the visual report (at the bottom) or in crashfiles?

No errors are reported by fmriprep in the reports or in crashfiles

Are you reusing previously computed results (e.g., FreeSurfer, Anatomical derivatives, work directory of previous run)?

Everything started from a clean work and output folder

fMRIPrep log

I saved the logs, they were sent to [email protected]

Encountered bug

The normalization of the anatomical files used to work with 20.1.1, but were horribly distorted with 20.2.0-LTS. I tried all versions available as singularity containers in between to find out what happened and summarize what I found below:

Version Anat normalization Details shared by email
20.1.1 no
20.1.2 no
20.1.3 yes
20.2.0rc0 no
20.2.0rc1 yes
20.2.0rc2 no
20.2.0-LTS yes

Below, a screenshot of the expected result (taken from 20.1.3), a screenshot from the intermediate result (taken from 20.2.0rc1)
and one from the 20.2.0-LTS version:

20.1.3, seems OK

2020-10-27-16H29 21

20.2.rc0, forgot some prefrontal areas?

2020-10-27-16H29 31

20.2.0-LTS not OK

2020-10-27-16H29 42

Summary of the report (identical for all reports except 20.1.2 that doesn't print the "Anatomical Conformation"):

Summary

  • Subject ID: 1003
    • Structural images: 1 T1-weighted
    • Functional series: [...]
    • Standard output spaces: MNI152NLin2009cAsym
    • Non-standard output spaces:
    • FreeSurfer reconstruction: Not run

Anatomical

Anatomical Conformation

  • Input T1w images: 1
  • Output orientation: RAS
  • Output dimensions: 240x320x320
  • Output voxel size: 0.65mm x 0.65mm x 0.65mm
  • Discarded images: 0

I'm happy to help in debugging this, however I can only run singularity versions so I could not bissect more to find the relevant commit(s).

EDIT for additional information.

I'm showing the output when starting from defaced images (with pydeface), but the same bug occurs without defacing. It also occurs when I remove the --fs-no-reconall flag, and it is similarly distorted for four out of my five subjects so far, with possible issues that I didn't investigate in the fifth.

@effigies
Copy link
Member

These appear to be different subjects. Have you run the same subjects with the different versions?

@mathias-sm
Copy link
Author

I just checked from the reports and, unless I'm mistaken, these are from the same subject and different versions. The commands all shared the same input bids folder and the flag --participant_label 1003 — in fact, as described above, the commands were entirely the same except for the version numbers. I'm happy to look deeper into this if this is the main suspicion (maybe remove all other participants from the bids folder?).

@effigies
Copy link
Member

Would it be possible for you to privately share this T1w image?

@oesteban
Copy link
Member

oesteban commented Oct 27, 2020

What kind of T1w sequence is this?

EDIT: That said, we definitely need this T1w image to be able to fix the pipeline. We made an improvement to our brain extraction and INU correction workflow that doesn't seem to work with your data. There's also some weirdness about the orientation headers in your last screencap.

EDIT: @effigies they seem different subjects because the reportlet is now discarding the rotation w.r.t. the image's axis.

@mathias-sm
Copy link
Author

Update: I shared the defaced T1w privately by email just now at [email protected]

Thanks again,

@oesteban
Copy link
Member

Hi @mathias-sm, thanks much for sharing the image - it has been useful.

As I was hinting above, by the realization of noise in the background but impressive contrast of the parenchyma I was guessing this is an MP2RAGE dataset. Your image just confirmed that.

Unfortunately, MP2RAGE has remained an open issue for fMRIPrep for a long while: https://github.com/nipreps/fmriprep/issues/431#issuecomment-352908217, #18, #35

What happened here is that prior to 20.1.2 fMRIPrep was working on this particular T1w just by chance. How large is this the full dataset? Have you been lucky with other subjects' T1w?

@oesteban oesteban transferred this issue from nipreps/fmriprep Oct 29, 2020
@oesteban oesteban added effort:high Estimated high effort task impact:medium Estimated medium impact task mp2rage problems derived from multi-echo T1w images skull-stripping Brain extraction problems labels Oct 29, 2020
@mathias-sm
Copy link
Author

Thanks for the information! My dataset contains five subjects so far. With 20.1.1 they all looked perfect (I'm not an expert but they were briefly looked at by a more experienced colleague who seemed to agree), while only one looks OK with 20.2.0-LTS. I have not tested intermediate versions on all subjects.
I can share all the defaced T1w if that helps — it changes nothing whether I deface or not, as far as I can tell.

@oesteban
Copy link
Member

The more the better, I could try to see why this iteration made brain extraction worse. And yes, please do not share faced data. :)

@mathias-sm
Copy link
Author

I just shared via email an archive with all 5 subjects' defaced anat. I'm going through the process of installing a bare-metal smriprep install to see if I can poke around and try to bisect the commits to find one that changed the behavior and get a better understanding of the workflow. I'll share what I find, but I suspect I'll make slow progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:high Estimated high effort task impact:medium Estimated medium impact task mp2rage problems derived from multi-echo T1w images skull-stripping Brain extraction problems
Projects
None yet
Development

No branches or pull requests

3 participants