MRtrix3 / mrtrix3

MRtrix3 provides a set of tools to perform various advanced diffusion MRI analyses, including constrained spherical deconvolution (CSD), probabilistic tractography, track-density imaging, and apparent fibre density
http://www.mrtrix.org
Mozilla Public License 2.0
283 stars 177 forks source link

5ttgen fsl: Renew tissue combination operations #1133

Open Lestropie opened 6 years ago

Lestropie commented 6 years ago

In fast, voxels outside the brain left behind by bad skull stripping can be labelled as white matter, resulting in erroneous seeding / tracking in ACT. So in 5ttgen fsl I run a connected-components filter on the WM image, and instead null these voxels from the output image (so they're treated as being outside the brain). However, the logic constructed around this fails to take into account the possibility that such a voxel may lie partly inside a sub-cortical GM structure. When this occurs (albeit likely erroneous in its own right), and the sub-cortical GM fraction is neither 1 nor 0 but somewhere in between, the recombination of fast WM/GM/CSF images with the SGM images from FIRST results in a non-unity sum of partial volume fractions, which 5ttcheck then warns the user about.

So I need to re-think the logic around this operation, and ideally find a way to remove those spurious WM voxels outside the brain but also prevent this warning from being issued when such an observation is made inside the brain.

thijsdhollander commented 6 years ago

An added criterium (on top of the connected-components WM filter) that potentially defines...

those spurious WM voxels outside the brain

...but doesn't include those "inside" the brain could be to check if they "touch the background", the latter being defined as the inverted brain mask. So if that makes sense, you could

  1. generate the voxels you'd exclude currently by "all WM segmented voxels" minus the "connected-component WM"
  2. generate the background mask by inverting the brain mask
  3. combine (i.e. logical union) the background mask with the currently excluded voxels (the latter is the output of step 1)
  4. select the biggest connected-component from the mask obtained in step 3
  5. subtract the background image (output of step 2) from the biggest connected-component (output of step 4)

The output of step 5 should then hopefully be the voxels that you'd want to exclude. These shouldn't include the spurious WM voxels inside the brain any more, if they didn't "touch the background".

Of course, this all hinges on the voxels that you want to exclude touching the background. I imagine that's the case? This is a small band of voxels just beyond the "real CSF" right? An there's nothing "beyond" those erroneous WM voxels any more that separates them from the very border of the brain mask?

Lestropie commented 6 years ago

Suspect it wouldn't be sensitive enough: Too few of the erroneous WM voxels will be at the outer edge of the mask. It tends to be skull that comes out as WM, but that's not necessarily the outer edge of the brain mask either. :-/

thijsdhollander commented 6 years ago

Hmm, yeah, I can imagine that indeed. In that case, I've got the feeling it's unavoidably going to be messy in one way or another... The next closest thing to patch up the above strategy in that case would be to, rather than requiring them to strictly "touch" the background, allow a certain distance (but that becomes an arbitrary parameter then of course...). I can imagine these voxels would still be (hopefully much) closer to the background than the ones in subcortical GM, so there might be a relatively safe and robust default for such a distance parameter.