Allow configuration of --no-csf in SynthStrip#1000
Allow configuration of --no-csf in SynthStrip#1000psadil wants to merge 6 commits intoPennLINC:masterfrom
--no-csf in SynthStrip#1000Conversation
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
|
Let me know if this should be configurable from the CLI |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1000 +/- ##
==========================================
+ Coverage 46.15% 46.18% +0.02%
==========================================
Files 65 65
Lines 9793 9802 +9
Branches 1083 1084 +1
==========================================
+ Hits 4520 4527 +7
- Misses 5045 5046 +1
- Partials 228 229 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
My intuition is that excluding CSF should be a straightforward improvement across the board, so it shouldn't need to be configurable, but I'll defer to @mattcieslak. |
|
I think we should keep it as an option because I'm not sure how it will interact with MSMT. If CSF is one of the tissues it needs to estimate, maybe it's useful to have some extra CSF in the brain mask? We should ask @36000 or @arokem if this is important. Many other models break down in the csf and we end up with implausible values, so keeping CSF out of the mask would be great |
|
If we need CSF in the brain mask for reconstruction, but it's causing problems for registration, then maybe we could produce two masks? fMRIPrep produces two boldrefs- one for motion correction and one for coregistration- so there's a precedent for that. |
mattcieslak
left a comment
There was a problem hiding this comment.
I think this should be a CLI parameter
|
To fit MSMT, you do need to estimate response functions, which is usually done by looking at ROIs in the "pure" WM, GM, CSF. So this would break, but I think we can work around that by making our own brain mask internally that includes the CSF for just these calculations. I think pyAFQ would be fine with having no CSF in the brain mask. By default, we do not use MSMT. I can't speak for how other software does this though. However, I still have two questions: (1) how reliable is this method? I would guess that removing the CSF is much trickier than doing a generic brain mask and (2) would it not be easier for readability and future software to have separate brain masks and CSF masks? Then QSIprep could pass the brain+CSF mask to certain pipelines and only the brain mask to other pipelines. |
--no-csf in SynthStrip
|
|
MRtrix workflows that do |
|
It sounds like having two brain masks- one for coregistration and one for steps like MSMT- might be the way to go. My initial idea that it would be fine to address that in a separate PR might have been too hasty. |
|
Are there preferences or opinions about how to name the masks? Currently, there is the single |
…during normalization
|
@tsalo , @mattcieslak , sorry, but I'm hitting a small snag. I only just realized that the version of
|
The latest qsiprep_build solves this issue (now at 7.4.1), so I think this is ready for review |
|
Sorry, just following up on this. Any update here, or something I can do to help move this forward? |
Changes proposed in this pull request
Allow configuration of the
--no-csfoption in the SynthStrip workflowand by default set it to True (currently implies False). Keep the currently implied default (False).Closes #954
Documentation that should be reviewed
Note
Adds a
--no-csfCLI flag andworkflow.no_csfconfig, plumbing the option into SynthStrip across anatomical, DWI, and fieldmap workflows.BooleanOptionalActionand add--no-csfflag inqsiprep/cli/parser.pyto control SynthStrip CSF removal.workflow.no_csfboolean inqsiprep/config.py.init_synthstrip_wfto acceptno_csfand pass it toFixHeaderSynthStrip/MockSynthStrip.no_csf=config.workflow.no_csfin:init_anat_preproc_wf, T2w preprocessing).init_dwi_reference_wf).init_extended_pepolar_report_wf).Written by Cursor Bugbot for commit 93e6630. This will update automatically on new commits. Configure here.