Describe the bug
In a typical run without a precomputed mask, INU is done on the whole-head image, with weights that can emphasize WM and the brainstem. In a run with a precomputed mask, INU appears to be done on the masked image, and the weights differ.
I think this happens in this branch:
|
# Run N4 if it hasn't been pre-run |
|
if not have_t1w: |
|
LOGGER.info('ANAT Skipping skull-strip, INU-correction only') |
|
n4_only_wf = init_n4_only_wf( |
|
omp_nthreads=omp_nthreads, |
|
atropos_use_random_seed=not skull_strip_fixed_seed, |
|
) |
init_n4_only_wf doesn't have a way to pass wm_prior to init_atropos_wf https://github.com/nipreps/niworkflows/blob/d991644f3a769d7c84e7c8bb897ea30fb96885df/niworkflows/anat/ants.py#L961-L966
so wm_prior always takes the default value of False https://github.com/nipreps/niworkflows/blob/d991644f3a769d7c84e7c8bb897ea30fb96885df/niworkflows/anat/ants.py#L474
meaning that the wm_prior is not applied https://github.com/nipreps/niworkflows/blob/d991644f3a769d7c84e7c8bb897ea30fb96885df/niworkflows/anat/ants.py#L793-L822
I think this difference in use of weights is a bug, but you may disagree. At minimum, I think this is behavior that should be documented (here and in fmriprep).
Exact command line executed
❯ docker run --rm -it -v /Users/psadil/Desktop/mask-test:/Users/psadil/Desktop/mask-test nipreps/smriprep --fs-license-file=/Users/psadil/Desktop/mask-test/code/license.txt --derivatives=/Users/psadil/Desktop/mask-test/sourcedata/synthstrip $PWD/sourcedata/raw $PWD participant
# or
❯ docker run --rm -it -v /Users/psadil/Desktop/mask-test:/Users/psadil/Desktop/mask-test nipreps/smriprep --fs-license-file=/Users/psadil/Desktop/mask-test/code/license.txt $PWD/sourcedata/raw $PWD participant
Are you positive that the input dataset is BIDS-compliant?
sMRIPrep feedback information
Visual reports of sMRIPrep
This is unrelated to the main concern (differences in how INU is applied), but the resulting reports end up looking different; the outputs with a precomputed mask have the mask applied.
Without precomputed mask
With precomputed mask
Installation type (please complete the following information):
Additional context
Possibly related: nipreps/nibabies#397
Describe the bug
In a typical run without a precomputed mask, INU is done on the whole-head image, with weights that can emphasize WM and the brainstem. In a run with a precomputed mask, INU appears to be done on the masked image, and the weights differ.
I think this happens in this branch:
smriprep/src/smriprep/workflows/anatomical.py
Lines 920 to 926 in 3c76b5b
init_n4_only_wfdoesn't have a way to passwm_priortoinit_atropos_wfhttps://github.com/nipreps/niworkflows/blob/d991644f3a769d7c84e7c8bb897ea30fb96885df/niworkflows/anat/ants.py#L961-L966so
wm_prioralways takes the default value ofFalsehttps://github.com/nipreps/niworkflows/blob/d991644f3a769d7c84e7c8bb897ea30fb96885df/niworkflows/anat/ants.py#L474meaning that the wm_prior is not applied https://github.com/nipreps/niworkflows/blob/d991644f3a769d7c84e7c8bb897ea30fb96885df/niworkflows/anat/ants.py#L793-L822
I think this difference in use of weights is a bug, but you may disagree. At minimum, I think this is behavior that should be documented (here and in fmriprep).
Exact command line executed
Are you positive that the input dataset is BIDS-compliant?
--skip-bids-validationargument).--skip-bids-validationargument.sMRIPrep feedback information
Visual reports of sMRIPrep
This is unrelated to the main concern (differences in how INU is applied), but the resulting reports end up looking different; the outputs with a precomputed mask have the mask applied.
Without precomputed mask
With precomputed mask
Installation type (please complete the following information):
Additional context
Possibly related: nipreps/nibabies#397