Dwi2mask error: empty mask

Hi all,
When I run dwi2mask on a preprocessed dwi image, I’m getting a blank mask (value of 0 everywhere). I don’t understand why this is happening, because I’ve run about 40 subjects with the same pipeline without an issue, but 3 subjects within this pipeline are having the same problem with blank masks.
Any advice would be greatly appreciated!

Hey @BennyD,

Sounds like you might have some kind of extreme outlier value in your data… but it’d still be strange to get 0 everywhere though. Can you try running with the -clean_scale 0 option, and reporting back what the output looks like?

Cheers,
Thijs

Thanks for you reply!
This was my command:

dwi2mask dwi_denoised_deringed_preproc_unbiased_normalised_upsampled.mif dwi_mask_upsampled1.mif -force -clean_scale 0 -debug
This was the output:
dwi2mask: [WARNING] existing output files will be overwritten
dwi2mask: [DEBUG] No config file found at "/etc/mrtrix.conf"
dwi2mask: [INFO] reading config file "/home/nir/.mrtrix.conf"...
dwi2mask: [DEBUG] reading key/value file "/home/nir/.mrtrix.conf"...
dwi2mask: [INFO] opening image "dwi_denoised_deringed_preproc_unbiased_normalised_upsampled.mif"...
dwi2mask: [DEBUG] reading key/value file "dwi_denoised_deringed_preproc_unbiased_normalised_upsampled.mif"...
dwi2mask: [DEBUG] sanitising image information...
dwi2mask: [INFO] image "dwi_denoised_deringed_preproc_unbiased_normalised_upsampled.mif" opened with dimensions 185x185x111x61, voxel spacing 1.3x1.3x1.3xnan, datatype Float32LE
dwi2mask: [DEBUG] memory-mapping file "dwi_denoised_deringed_preproc_unbiased_normalised_upsampled.mif"...
dwi2mask: [DEBUG] file "dwi_denoised_deringed_preproc_unbiased_normalised_upsampled.mif" mapped at 0x7fcb306fe000, size 926949900 (read-only)
dwi2mask: [DEBUG] image "dwi_denoised_deringed_preproc_unbiased_normalised_upsampled.mif" loaded
dwi2mask: [DEBUG] image "dwi_denoised_deringed_preproc_unbiased_normalised_upsampled.mif" initialised with strides = [ -61 -11285 2087725 1 ], start = 2087664, using direct IO
dwi2mask: [DEBUG] searching for suitable gradient encoding...
dwi2mask: [INFO] found 61x4 diffusion gradient table
dwi2mask: [INFO] b-values will be scaled by the square of DW gradient norm
dwi2mask: [DEBUG] sanitising image information...
dwi2mask: [DEBUG] allocating scratch buffer for image "brain mask"...
dwi2mask: [DEBUG] image "brain mask" loaded
dwi2mask: [DEBUG] image "brain mask" initialised with strides = [ -1 -185 34225 ], start = 34224, using direct IO
dwi2mask: [DEBUG] sanitising image information...
dwi2mask: [DEBUG] allocating scratch buffer for image "DWI mask"...
dwi2mask: [DEBUG] image "DWI mask" loaded
dwi2mask: [DEBUG] image "DWI mask" initialised with strides = [ -1 -185 34225 ], start = 34224, using direct IO
dwi2mask: [INFO] Diffusion gradient encoding data clustered into 1 non-zero shells and 1 b=0 volumes
dwi2mask: [DEBUG] Shells: b = { 0(1) 1000.0000000143856(60) }
dwi2mask: [DEBUG] sanitising image information...
dwi2mask: [DEBUG] allocating scratch buffer for image "mean b=0 image"...
dwi2mask: [DEBUG] image "mean b=0 image" loaded
dwi2mask: [DEBUG] image "mean b=0 image" initialised with strides = [ -1 -185 34225 ], start = 34224, using direct IO
dwi2mask: [.   ] computing dwi brain mask... 
dwi2mask: [DEBUG] sanitising image information...
dwi2mask: [DEBUG] allocating scratch buffer for image "scratch image"...
dwi2mask: [DEBUG] image "scratch image" loaded
dwi2mask: [DEBUG] image "scratch image" initialised with strides = [ -1 -185 34225 ], start = 34224, using direct IO
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [  0%] finding min/max of "mean b=0 image"... 
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [100%] finding min/max of "mean b=0 image"... 
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [100%] finding min/max of "mean b=0 image"
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [.   ] optimising threshold... 
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [ .  ] optimising threshold... 
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [done] optimising threshold
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [  0%] thresholding... 
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [100%] thresholding... 
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [100%] thresholding
dwi2mask: [  . ] computing dwi brain mask... 
dwi2mask: [DEBUG] deleting scratch buffer for image "scratch image"...
dwi2mask: [DEBUG] image "scratch image" unloaded
dwi2mask: [DEBUG] deleting scratch buffer for image "mean b=0 image"...
dwi2mask: [DEBUG] image "mean b=0 image" unloaded
dwi2mask: [DEBUG] sanitising image information...
dwi2mask: [DEBUG] allocating scratch buffer for image "mean b=1000 image"...
dwi2mask: [DEBUG] image "mean b=1000 image" loaded
dwi2mask: [DEBUG] image "mean b=1000 image" initialised with strides = [ -1 -185 34225 ], start = 34224, using direct IO
dwi2mask: [   .] computing dwi brain mask... 
dwi2mask: [DEBUG] sanitising image information...
dwi2mask: [DEBUG] allocating scratch buffer for image "scratch image"...
dwi2mask: [DEBUG] image "scratch image" loaded
dwi2mask: [DEBUG] image "scratch image" initialised with strides = [ -1 -185 34225 ], start = 34224, using direct IO
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [  0%] finding min/max of "mean b=1000 image"... 
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [100%] finding min/max of "mean b=1000 image"... 
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [100%] finding min/max of "mean b=1000 image"
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [.   ] optimising threshold... 
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [ .  ] optimising threshold... 
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [done] optimising threshold
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [  0%] thresholding... 
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [100%] thresholding... 
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [100%] thresholding
dwi2mask: [ .  ] computing dwi brain mask... 
dwi2mask: [DEBUG] deleting scratch buffer for image "scratch image"...
dwi2mask: [DEBUG] image "scratch image" unloaded
dwi2mask: [DEBUG] deleting scratch buffer for image "mean b=1000 image"...
dwi2mask: [DEBUG] image "mean b=1000 image" unloaded
dwi2mask: [DEBUG] sanitising image information...
dwi2mask: [DEBUG] allocating scratch buffer for image "temporary mask"...
dwi2mask: [DEBUG] image "temporary mask" loaded
dwi2mask: [DEBUG] image "temporary mask" initialised with strides = [ -1 -185 34225 ], start = 34224, using direct IO
dwi2mask: [DEBUG] median adapter for image "DWI mask" initialised with extent [ 3 3 3 ]
dwi2mask: [DEBUG] initialising threads...
dwi2mask: [DEBUG] launching 8 threads "loop threads"...
dwi2mask: [DEBUG] waiting for completion of threads "loop threads"...
dwi2mask: [DEBUG] threads "loop threads" completed OK
dwi2mask: [   .] computing dwi brain mask... 
dwi2mask: [DEBUG] sanitising image information...
dwi2mask: [DEBUG] allocating scratch buffer for image "scratch image"...
dwi2mask: [DEBUG] image "scratch image" loaded
dwi2mask: [DEBUG] image "scratch image" initialised with strides = [ -1 -185 34225 ], start = 34224, using direct IO
dwi2mask: [DEBUG] deleting scratch buffer for image "scratch image"...
dwi2mask: [DEBUG] image "scratch image" unloaded
dwi2mask: [  . ] computing dwi brain mask... 
dwi2mask: [DEBUG] sanitising image information...
dwi2mask: [DEBUG] allocating scratch buffer for image "scratch image"...
dwi2mask: [DEBUG] image "scratch image" loaded
dwi2mask: [DEBUG] image "scratch image" initialised with strides = [ -1 -185 34225 ], start = 34224, using direct IO
dwi2mask: [DEBUG] deleting scratch buffer for image "scratch image"...
dwi2mask: [DEBUG] image "scratch image" unloaded
dwi2mask: [ .  ] computing dwi brain mask... 
dwi2mask: [DEBUG] deleting scratch buffer for image "temporary mask"...
dwi2mask: [DEBUG] image "temporary mask" unloaded
dwi2mask: [done] computing dwi brain mask
dwi2mask: [DEBUG] deleting scratch buffer for image "DWI mask"...
dwi2mask: [DEBUG] image "DWI mask" unloaded
dwi2mask: [INFO] creating image "dwi_mask_upsampled1.mif"...
dwi2mask: [DEBUG] sanitising image information...
dwi2mask: [DEBUG] creating empty file "dwi_mask_upsampled1.mif"
dwi2mask: [DEBUG] resizing file "dwi_mask_upsampled1.mif" to 480628
dwi2mask: [DEBUG] sanitising image information...
dwi2mask: [INFO] image "dwi_mask_upsampled1.mif" created with dimensions 185x185x111, voxel spacing 1.3x1.3x1.3, datatype Bit
dwi2mask: [DEBUG] memory-mapping file "dwi_mask_upsampled1.mif"...
dwi2mask: [DEBUG] file "dwi_mask_upsampled1.mif" mapped at 0x7fcb69cbe000, size 474872 (read-write)
dwi2mask: [DEBUG] image "dwi_mask_upsampled1.mif" loaded
dwi2mask: [DEBUG] image "dwi_mask_upsampled1.mif" initialised with strides = [ -1 -185 34225 ], start = 34224, using direct IO
dwi2mask: [DEBUG] unmapping file "dwi_mask_upsampled1.mif"
dwi2mask: [DEBUG] image "dwi_mask_upsampled1.mif" unloaded
dwi2mask: [DEBUG] deleting scratch buffer for image "brain mask"...
dwi2mask: [DEBUG] image "brain mask" unloaded
dwi2mask: [DEBUG] unmapping file "dwi_denoised_deringed_preproc_unbiased_normalised_upsampled.mif"
dwi2mask: [DEBUG] image "dwi_denoised_deringed_preproc_unbiased_normalised_upsampled.mif" unloaded
1 Like

Hehe, ok, by “output”, I meant the final image after this particular run (with the clean_scale 0 option). :slightly_smiling_face: Does that one still contain only all zeros? You can even check the latter aspect conveniently via mrstats.

I haven’t checked every single line in detail, but the debugging output generally looks alright. I’m guessing it’s not really a bug, but truly some strange value in your data maybe. So the image output after adding that option might help to diagnose where the weirdness is potentially going on in your input image.

@ThijsDhollander ah okay sorry for sending all those lines!
Yes, the image output still appears to be all 0’s when viewed with mrview.
mrstats shows there must be some voxels with a very small value, because this is the output:
volume mean median stdev min max count
[ 0 ] 0.00973341 0 0.0981768 0 1 3798975

1 Like

No worries. :relaxed:

…well… since the output is a binary image, mrstats is telling you you’re overlooking some voxels with a value of 1. :wink: So not all voxels would be zero for sure. In fact, from this output, it’s essentially telling you there’s 0.97…% of all 3798975 voxels that have a 1. That’s still quite a few voxels. Since you’re overlooking them, I’m starting to suspect they’re towards or on the edge of the FOV of your image. Just a wild guess, but did you run dwibiascorrect on your data before running dwi2mask? If yes, that might’ve messed it up. In that case, try running on the data without having dwibiascorrect applied to it. In any case, do scroll through the entire “mask” volume after this run, and try to find those voxels. Once found, check the image you’re providing to dwi2mask in that area for problems.

Hi @ThijsDhollander,
Sorry for the slow reply. Yes you’re totally right, if I scroll all the way down to the bottom of the image I see parts of the cerebellum which survived somehow…
Should I not perform the bias correction prior to masking? I followed one of the pipelines from the website but maybe it was outdated?
Ben

1 Like

No worries!

Yep, that makes sense! Alright, so now the question is what those parts look like in your DWI dataset that you provides to dwi2mask. They should be very bright (i.e. high in intensity). The other question is if this is due to an artefact, or otherwise. So step one would be to inspect those images (feel free to show a screenshot on here; best would be a sagittal or coronal view of a relevant slice).

Not sure which parts of docs you were looking at. The most recent ones, I think, as well as other parts of documentation I have written elsewhere, clarify this somewhat. The gist is: no, you don’t have to perform bias correction at that stage in the pipeline generally, at least when you intend to perform MSMT-CSD or SS3T-CSD later on in your pipeline. This is because you can then apply mtnormalise right after MSMT-CSD or SS3T-CSD, which does the bias correction “instead”, and as a bonus adds the global intensity normalisation you’ll likely also require in a quantitative analysis.

However! If that’s the case, then why is dwibiascorrect even still mentioned at all in the docs, you might ask? Well, because there’s at least 1 step before mtnormalise in the pipeline where dwibiascorrect might help you, but alternatively might also ruin your day. And that step is dwi2mask indeed. Due to how dwi2mask works, it relies on at least having a “not too severe” bias field. In that regard dwibiascorrect might help you, if you do have a bit of a severe bias field. However! dwibiascorrect itself relies on a half-decent mask (which by default it estimates itself). Because of that, dwibiascorrect can sometimes make things far worse, rather than fix them. One of the ways in which it can make them worse, is possibly the exact situation you’re in. So the gist here is: choose to run dwibiascorrect “or not”, depending on how much it helps you to run dwi2mask decently (or not). There’s no other considerations mostly, as for the actual “final” bias field correction, mtnormalise will do the job in principle later on.

So questions for you:

  1. Did you run dwibiascorrect before dwi2mask when you encountered this issue?

  2. Regardless of question 1, what does the data look like at the point where you provide it to dwi2mask?

I hope this also gives you some insights into what’s going on, and what the relationship between these steps is!

Cheers,
Thijs

This is extremely helpful. Thank you @ThijsDhollander!
Yes, it seems that in about 5% of my subjects, dwibiascorrect resulted in extremely bright/artifactual signals in the midbrain/brainstem which were not there previously. I was running it prior to dwi2mask, which generated the mask issue as well! I’m leaning towards repeating my pipeline without dwibiascorrect.

1 Like

No worries at all; happy to help!

Oh yes, wow, given what you show in the screenshot, I’m not surprised dwi2mask would fall over completely. At this rate, it would likely be problematic for a few other specific processing steps in the pipeline as well, even though they might seem fine at first sight.

Yes, absolutely. Make sure to run mtnormalise later on the pipeline, right after either MSMT-CSD or SS3T-CSD. But first and foremost: when running without dwibiascorrect, do still check your masks of course. dwi2mask is far from perfect. Sometimes, a manual fix or two afterwards can help. Otherwise, good results have also been observed using e.g. FSL’s BET tool on an average b=0 image. You might even run both and try to combine the results, if either tool on its own does not result in a decent outcome. It’s not per se necessary that brain mask estimation is fully automated (although it’s convenient of course, especially for large groups of subjects). You just need decent brain mask at that step (even when manually corrected), and then you can happily proceed with the pipeline. :wink: :+1:

Is it also alright to perform intensity normalisation via dwiintensitynorm right after the dwi2mask step? I had been following this pipeline (https://mrtrix.readthedocs.io/en/latest/fixel_based_analysis/st_fibre_density_cross-section.html) since I only have b1000 images and no reverse-phase correction images

1 Like

Yep, that’s one option; however, there’s a number of challenges and limitations with that approach (dwiintensitynorm) to intensity normalisation. Take a look around the forum for some relevant discussions. In any case, having single-shell data is not a show-stopper on this front though: you can perform…

  • 2-tissue (WM-CSF) CSD with MSMT-CSD
  • 3-tissue (WM-GM-CSF) CSD with SS3T-CSD

…on your data. Both are technically compatible with following up with mtnormalise for intensity normalisation and bias field correction.
That said, there’s a few more complex limitations as well as strong considerations as to final interpretation if you use specifically 2-tissue CSD + mtnormalise though. There are scenarios where one might argue it’s not exactly the right thing to do, and it has interesting implications for the outcome; both in terms of global as well as spatially varying intensity normalisation. This is mostly of concern at lower b-values. This is not really the best place (and timing) to elaborate on such though.