-
Notifications
You must be signed in to change notification settings - Fork 58
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
pyAFQ pipeline: Use previous analysis derivatives as inputs for masks: seed and brain. #571
Conversation
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 |
@@ -16,7 +16,7 @@ | |||
"directions": "prob", | |||
"max_angle": 30.0, | |||
"sphere": "", | |||
"seed_mask": "", | |||
"seed_mask": "ImageFile('suffix': 'WM', {'scope': 'qsiprep', 'space': None})", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @36000 : should this use an ImageFile
or a MaskFile
object? Would this work as written here? That is, do these names (ImageFile
, MaskFile
) exist in the namespace in which this config is run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, can anyone tell me how mrtrix pipelines choose where to place seeds? In particular, the msmt_noACT pipeline?
@@ -79,6 +79,7 @@ def init_pyafq_wf(omp_nthreads, available_anatomical_data, | |||
('bval_file', 'bval_file'), | |||
('bvec_file', 'bvec_file'), | |||
('dwi_mask', 'mask_file'), | |||
('wm_mask', 'wm_mask_file'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattcieslak : what should we put here for wm_mask
?
Updated (with help from @36000, thank you!) to do this the right way. The config is now explicit about using the |
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.
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? |
Is this something we should reproduce in QSIRecon? |
Yes, that would be great. We routinely do this kind of thing when we run pyAFQ on top of qsiprep derivatives, and it's beneficial. The default for brain-masking in pyAFQ, in particular, is quite poor as it relies on the (not very good) median Otsu algorithm for brain extraction. |
I've opened PennLINC/qsirecon#170 to track this in QSIRecon. I'll close this PR since there's no way to merge it in QSIPrep but I have a link to it from the QSIRecon issue so someone can copy over the changes to their own branch at some point. |
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