I am trying to use the script dwiintensitynorm. I have encountered some problems
Thanks very much,
Command: transformcalc linear_transform_average.txt invert linear_transform_average_inv.txt -force -quiet
Traceback (most recent call last):
File “/usr/local/mrtrix3/scripts/population_template”, line 273, in
average_inv = numpy.loadtxt(‘linear_transform_average_inv.txt’)
NameError: name ‘numpy’ is not defined
dwiintensitynorm_nk: Changing back to original directory (/home/vz017902/Documents/Processed/normalisation)
dwiintensitynorm_nk: Deleting temporary directory /tmp/dwiintensitynorm_nk-tmp-U8LKYA/
there is no option to add the gradient table (although I can add this manually in the dwiintensitynorm script)
The limitation here is that you would be assuming that a single gradient table is applicable for all images in the input directory. This is not necessarily the case: apart from gross differences in acquisition protocol (which could technically still work with this script), you could have subjects where not all volumes were acquired, or you could have per-subject rotated gradient tables from motion correction. So although you could modify the script to add such an option for your own convenience, it’s in fact a deliberate omission.
But I have a numpy error too (see below). Could you help me where I have gone wrong?
NameError: name 'numpy' is not defined
numpy is an additional dependency that is not included by default with Python, and so needs to be installed explicitly. It is not listed as an installation requirement in the documentation because it’s purely a runtime dependency. Though we should modify the offending scripts to catch this missing dependency and give a more upfront & clear error.
I’m sure you already know how to fix this, however just in case: You will need to add the gradients to the image file and save it as a .mif image. This can be done with