Sct_denoising_onlm error- sct version 4.0.2

Dear Dr Cohen-Adad,

I am trying to denoise my T2w images. While running this command: sct_denoising_onlm -i T2.nii.gz
I encounter the error that I am pasting here.

Spinal Cord Toolbox (4.0.2)

Applying Non-local mean filter…
total time: 1.9073486328125e-06
vol size
Traceback (most recent call last):
File “/home/willi/sct_4.0.2/scripts/”, line 194, in
main(file_to_denoise, param, output_file_name)
File “/home/willi/sct_4.0.2/scripts/”, line 137, in main
before = data[:, :, axial_middle].T
IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices

Could you please help me with that?

Thank you very much!

Kind Regards,

Hi Merve,

I can reproduce this bug and have opened a ticket here. This function is rarely used, so we didn’t pay enough attention to the cross-compatibility across SCT versions. Thank you very much for reporting this bug.


Dear Merve,

We fixed the issue with sct_denoising_onlm. Thank you again for reporting this bug.

Until we create a new release, you can already get and test it out in the master’s branch

We will create a new SCT version 4.0.3 with the fix, which you will be able to download here:


Thank you very much!