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

Refine ANTs brain mask with FreeSurfer #231

Closed
chrisgorgo opened this issue Apr 3, 2017 · 14 comments
Closed

Refine ANTs brain mask with FreeSurfer #231

chrisgorgo opened this issue Apr 3, 2017 · 14 comments
Labels
bug Something isn't working effort:high Estimated high effort task freesurfer FreeSurfer related improvements and issues impact:high Estimated high impact task mp2rage problems derived from multi-echo T1w images skull-stripping Brain extraction problems

Comments

@chrisgorgo
Copy link
Collaborator

Sometimes ANTs brainmasks fails
image
ds114 subject 01

However we can use the refined brainmask obtained from the FreeSurfer reconstruction (like here: https://github.com/BIDS-Apps/nipypelines/blob/master/run.py#L401)

@effigies
Copy link
Member

effigies commented Apr 4, 2017

We inject the ANTs brainmask before aparc occurs.

@effigies
Copy link
Member

effigies commented Apr 4, 2017

Well, I suppose as long as it only ever fails by including too much and never too little, we can use it.

@chrisgorgo
Copy link
Collaborator Author

chrisgorgo commented Apr 4, 2017 via email

@effigies
Copy link
Member

effigies commented Apr 4, 2017

So the idea is to continue to inject ANTs as a prior, and then let a binarized aparc be the final mask we use?

That should be pretty easy. I assume we don't want to turn around and use the updated mask to fix recon-all.

@chrisgorgo
Copy link
Collaborator Author

chrisgorgo commented Apr 4, 2017 via email

@chrisgorgo
Copy link
Collaborator Author

So I've tried this last night and the problem I run into is that the aparc based mask is too tight and needs to be dilated. However, when you dilate it (even when using one voxel) the result is worse (includes more non-brain) than the initial ANTs mask.

@effigies
Copy link
Member

effigies commented Apr 4, 2017

What about setting the mask to sum(dilated_aparc + ANTs) == 2?

@oesteban
Copy link
Member

oesteban commented May 5, 2017

I'd bet @binarybottle's opinion on this will be very valuable to make a decision here. Arno, can we ask you what do you think about FreeSurfer's and ANTS' brain masks? And how to combine them?

@binarybottle
Copy link

binarybottle commented May 5, 2017

Thanks for asking! Because I have also found FreeSurfer and ANTs to under- and over-segment as mentioned above, I wrote the following function to try and reconcile the two:
https://github.com/nipy/mindboggle/blob/master/mindboggle/guts/segment.py#L1660

The docstring says::

Combine the voxels of one label from two files and overlay them
on the second label combined from the two files.

An example application is to combine two segmentation volumes,
such as from FreeSurfer and ANTs, to obtain a single cortex=2
and noncortex=3 segmentation file, by taking the union of cortex voxels
from the segmentations, the union of the noncortex voxels from the
segmentations, and overwriting intersecting cortex and noncortex voxels
with noncortex (3) labels.

ANTs tends to include more cortical gray matter at the periphery of
the brain than Freesurfer, and FreeSurfer tends to include more white
matter that extends deep into gyral folds than ANTs, so this function
attempts to remedy their differences by overlaying ANTs cortical gray
with FreeSurfer white matter.

Example preprocessing steps ::

   1. Run Freesurfer and antsCorticalThickness.sh on T1-weighted image.
   2. Convert FreeSurfer volume labels (e.g., wmparc.mgz or aparc+aseg.mgz)
       to cortex (2) and noncortex (3) segments using relabel_volume()
       function [refer to labels.rst or FreeSurferColorLUT labels file].
   3. Convert ANTs Atropos-segmented volume (tmpBrainSegmentation.nii.gz)
       to cortex and noncortex segments, by converting 1-labels to 0 and
       4-labels to 3 with the relabel_volume() function
       (the latter is to include deep-gray matter with noncortical tissues).

@chrisgorgo
Copy link
Collaborator Author

Here's another example where freesurfer mask could be used to refine the ANTs one

ANTs
image

FreeSurfer
image

It's subject 010125 from ds000221 (MP2RAGE acqusition).

@chrisgorgo
Copy link
Collaborator Author

Another case
image

ds000017/sub-2

@oesteban
Copy link
Member

Well, I would not include MP2RAGE here. We could try to generate a template for MP2RAGE adding noise around the head.

@oesteban
Copy link
Member

Alright, I think we are getting to something functional on nipreps/fmriprep#912. There is a combination of Arno's ideas and some new.

The problem I could not think a solution for is when ANTs cuts out the outermost bend of some gyri. That happens from time to time.

@chrisgorgo
Copy link
Collaborator Author

For the MP2RAGE case it might be worth trying one of the inversion images instead of the T1w image. See poldracklab/pydeface#15 for more insights.

@oesteban oesteban transferred this issue from nipreps/fmriprep Oct 29, 2020
@oesteban oesteban added bug Something isn't working effort:high Estimated high effort task freesurfer FreeSurfer related improvements and issues impact:high Estimated high impact task mp2rage problems derived from multi-echo T1w images skull-stripping Brain extraction problems labels Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working effort:high Estimated high effort task freesurfer FreeSurfer related improvements and issues impact:high Estimated high impact task mp2rage problems derived from multi-echo T1w images skull-stripping Brain extraction problems
Projects
None yet
Development

No branches or pull requests

4 participants