Error from dwi2response


I have got a multi-shell data (b=10,1000,2000) to process with MRtrix, and I am using the dhollander method to obtain the response functions. However, for some subjects, the processing are perfect, but for some I got an error while the correct shells were detected by the software. I am wondering if anyone has encountered this before?

The error follows:
command: dwiextract dwi.mif -shell 10 - | mrmath - mean mean_b10.mif -axis 3
dwi2response: [ERROR] Cammand failed: dwiextract dwi.mif -shell 10 - | mrmath - mean mean_b10.mif -axis 3 (
dwi2response: Output of failed command:
dwiextract: [ERROR] User selected b=0 shell, but no such data was found

Hi @xiaobird,

I haven’t encountered this exactly with dwi2response yet, but it does remind me of another similar recent experience in a somewhat related scenario. For the purpose of allowing you to quickly continue your analysis, I’d suggest averaging the response functions (for each tissue type) of the subjects where you didn’t run into this error. That should generally be completely fine.

In the mean time, trying to get some insight into the problem to make sure I get the right idea:

What do you get when you set the BZeroThreshold configuration option in a configuration file to a value of 15? You can store it in a system wide location or create a user specific one, as detailed here.
What do you get if you set the BZeroThreshold configuration option to a value of 2?

If all the above still fails, please send me a private message; we might arrange a data transfer that’ll allow me to diagnose the situation in more detail. It might take a while though, as I’m pretty occupied with a few other things at the moment; so do go through the above steps first to see if they resolve issues.


EDIT: removed a suggestion that wasn’t necessary to diagnose the problem

Thank you so much for the reply.
From the online document, it seems like the BZeroThreshold is set to 10, which is the lowest b value we have.

This is for the 7T data, and there are some operation that requires some image transformation and bvec reorientation for dealing with 7T distortion issues. I think this is why for some cases they are fine and some have trouble passing the threshold.

However, for my installation on both my mac and ubuntu, I have a hard time locating the file mrtrix.conf as specified in the online document (even with Spotlight search on the mac). Would you have any idea where they are installed?

That makes sense. And editing your BZeroThreshold config file variable is probably the simplest solution here. Alternative would be to modify your bvals manually to ensure those b=0 volumes are genuinely recorded as b=0…

This file doesn’t exist by default. You’ll need to create it yourself and edit it as required. I think on macOS the command open -e ~/.mrtrix.conf should do it.

I’m not sure I agree that it’s a good idea to instruct users to install an independent fork of MRtrix3’s development branch, to diagnose a problem on our main release branch. Besides, the code you’re referring to is already available on our repository and accessible with a simple git checkout dev.

Users should note that the 3Tissue repo essentially provides the entire contents of our development (dev) branch – which we ourselves haven’t released yet – with the addition of the ss3t_csd_beta script to perform single-shell 3-tissue CSD. We don’t consider that version of the MRtrix3 code as suitable for deployment yet. Furthermore, issues with the 3Tissue repo should really be addressed to the appropriate forum, according to the 3Tissue documentation itself – not the main MRtrix3 forum. It is an independent project, not officially affiliated to the MRtrix3 project, or endorsed by its development team.

With the best intentions, I think there’s a misunderstanding about the issue I’m trying to address actually.

In any case, @xiaobird , I’ve looked a bit further into the details of what’s exactly going on; I can get by now with these tests:

…also now when run with your version. So that’s fine, if it avoids unnecessary frictions.

To clarify the tests: so with the original threshold default (10), you reported some issues happening with some, but not all datasets. What I’d like to see tested is, whether setting the threshold (via the config file, as above) to either 2, or 15; and then test all datasets for each of both values. I’d be curious to see which of those values (2 or 15) makes it work across the board for all datasets; if any of those even does of course.

That explains why you get different behaviour for different datasets at the moment, with the threshold set at 10 “exactly”. The actual issue though is the error: it should work regardless of threshold. Getting your result from testing with 2 and 15 as config file values will help to diagnose.

@xiaobird, thanks again for reporting; it’s very useful. :+1:


I tried B0 threshold with 15. It works.
Thanks a lot.

1 Like

In the meantime, I’ve figured out the issue, but it’s less likely to happen than in the other scenario I mentioned earlier, and in this case it can be fixed most of the time with modification of the threshold. So the urgency is relatively low luckily. I’ll take note and fix on my end at some point in the future. Thanks again; useful info. :+1:

1 Like