pyAFQ pipeline: Use previous analysis derivatives as inputs for masks: seed and brain.
Changes proposed in this pull request
This changes the defaults for seed mask and brain mask for the pyAFQ pipeline, using pyAFQ's mask definition API.
Might resolve #563
The same change should be made to this file: https://github.com/PennLINC/qsiprep/blob/master/qsiprep/data/pipelines/mrtrix_multishell_msmt_pyafq_tractometry.json
Updated (with help from @36000, thank you!) to do this the right way. The config is now explicit about using the WM_prob output to avoid confusion (it turns out that I was wrong in #563, because the default settings use FA with 0.2 as a threshold, but that logic is a bit hidden in pyAFQ, which we will also fix separately...), and a probability of 0.5 as the threshold.
I think some of the recent changes in the anatomical workflow are causing some of the data AFQ previously used to not be present anymore. I'm definitely open to suggestions on a best default behavior here, but I really like the idea of using a low FA threshold instead of an anatomically defined WM mask. This is because the anatomical masks are unreliable because they can come from a couple sources.
- If 0.17 or earlier is used there may be a 3-tissue
dsegand aprobsegfrom FAST. These are almost always bad. - QSIPrep After 0.17 will have a 3-tissue
dsegfrom SynthSeg. These are usually excellent, but it's still a new method and I have seen some bad failures with it. - For recon-only you may have a great segmentation from non-synth FreeSurfer available. This is also just a deterministic segmentation, though.
- If the user ran a --dwi-only you have a mask based only on a mostly reliable b=0 masking method.
Also if the user doesn't have fieldmaps available the t1w or t2w-based tissue masks won't align well with the processed dwi data.
For the mrtrix hsvs we require a freesurfer segmentation, which guarantees good results as long as susceptibility distortion was run. We could impose a requirement that a good anatomical segmentation from freesurfer is available if the user wants to use it for AFQ. It seems simpler and (if no fieldmap is available) more effective to use a FA mask.
What do you think?