`Joint PDF summed to zero` during motion correction (`sct_dmri_moco`) on SCT v6.4

When trying to apply motion correction, the following error appears:

Full error log
sct_dmri_moco -i dmri.nii.gz -m mask_dmri_dwi_mean.nii.gz -bvec bvecs.bvec \
              -qc ~/qc_singleSubj -qc-seg dmri_dwi_mean_seg.nii.gz
--
Spinal Cord Toolbox (6.4)

sct_dmri_moco -i dmri.nii.gz -m mask_dmri_dwi_mean.nii.gz -bvec bvecs.bvec -qc /home/siying/qc_singleSubj -qc-seg dmri_dwi_mean_seg.nii.gz
--


Input parameters:
  Input file ............ dmri.nii.gz
  Group size ............ 3
Creating temporary folder (/tmp/sct_2024-11-03_18-11-12_moco-wrapper_tfz5g217)

Copying input data to tmp folder and convert to nii...

Get dimensions of data...
  192 x 192 x 70

Data orientation: RPI
  Treated as axial

Set suffix of transformation file name, which depends on the orientation:
Orientation is axial, suffix is 'Warp.nii.gz'. The estimated transformation is a 3D warping field, which is composed of a stack of 2D Tx-Ty transformations

Identify b=0 and DWI images...
  WARNING: bvecs file is 3xn instead of nx3. Consider using sct_dmri_transpose_bvecs.
  Transpose bvecs...
  Number of b=0: 1 [0]
  Number of DWI: 60 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60]

Split along T dimension...

Merge and average b=0 data...
Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:   0%|                             | 0/20 [00:00<?, ?iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:   5%|β–ˆ                    | 1/20 [00:00<00:16,  1.18iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  10%|β–ˆβ–ˆ                   | 2/20 [00:01<00:15,  1.16iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  15%|β–ˆβ–ˆβ–ˆβ–                 | 3/20 [00:02<00:14,  1.15iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  20%|β–ˆβ–ˆβ–ˆβ–ˆβ–                | 4/20 [00:03<00:13,  1.17iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  25%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž               | 5/20 [00:04<00:12,  1.18iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  30%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž              | 6/20 [00:05<00:11,  1.22iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  35%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž             | 7/20 [00:05<00:10,  1.21iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  40%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–            | 8/20 [00:06<00:10,  1.20iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  45%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–           | 9/20 [00:07<00:09,  1.17iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  50%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ          | 10/20 [00:08<00:08,  1.18iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  55%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ         | 11/20 [00:09<00:07,  1.19iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  60%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ        | 12/20 [00:10<00:06,  1.18iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  65%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ       | 13/20 [00:10<00:05,  1.19iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  70%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ      | 14/20 [00:11<00:05,  1.19iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  75%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ     | 15/20 [00:12<00:04,  1.19iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  80%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ    | 16/20 [00:13<00:03,  1.18iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  85%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   | 17/20 [00:14<00:02,  1.19iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  90%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  | 18/20 [00:15<00:01,  1.19iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  95%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ | 19/20 [00:15<00:00,  1.20iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 20/20 [00:16<00:00,  1.19iter/s]

Merge across groups...

-------------------------------------------------------------------------------
  Estimating motion on b=0 images...
-------------------------------------------------------------------------------

Input parameters:
  Input file ............ b0.nii
  Reference file ........ data_T0000.nii.gz
  Polynomial degree ..... 2
  Smoothing kernel ...... 1
  Gradient step ......... 1
  Metric ................ MI
  Sampling .............. None
  Todo .................. estimate_and_apply
  Mask  ................. mask.nii
  Output mat folder ..... mat_b0groups

Data dimensions:
  192 x 192 x 70 x 1

Copy file_target to a temporary file...

Register. Loop across Z (note: there is only one Z if orientation is axial)
Z=0/0:   0%|                                            | 0/1 [00:00<?, ?iter/s]
Traceback (most recent call last):
  File "/opt/sct/spinalcordtoolbox/scripts/sct_dmri_moco.py", line 233, in <module>
    main(sys.argv[1:])
  File "/opt/sct/spinalcordtoolbox/scripts/sct_dmri_moco.py", line 218, in main
    fname_output_image = moco_wrapper(param)
  File "/opt/sct/spinalcordtoolbox/moco.py", line 329, in moco_wrapper
    file_mat_b0, _ = moco(param_moco)
  File "/opt/sct/spinalcordtoolbox/moco.py", line 609, in moco
    failed_transfo[it] = register(param, file_data_splitZ_splitT[it], file_target_splitZ[iz], file_mat[iz][it],
  File "/opt/sct/spinalcordtoolbox/moco.py", line 753, in register
    status, output = run_proc(cmd, verbose=1 if param.verbose == 2 else 0, env=env, **kw)
  File "/opt/sct/spinalcordtoolbox/utils/sys.py", line 342, in run_proc
    raise RuntimeError(output)
RuntimeError: setting mask /tmp/sct_2024-11-03_18-11-12_moco-wrapper_tfz5g217/mask.nii
Exception caught:
itk::ExceptionObject (0x60433b0)
Location: "unknown"
File: /__w/build_ANTs/build_ANTs/antsbin/staging/include/ITK-5.1/itkMattesMutualInformationImageToImageMetricv4.hxx
Line: 312
Description: itk::ERROR: MattesMutualInformationImageToImageMetricv4(0x4cd0be0): Joint PDF summed to zero

Next,i tried to use another metric: -param MeanSquares
 sct_dmri_moco -i dmri.nii.gz -m mask_dmri_dwi_mean.nii.gz -bvec bvecs.bvec -param MeanSquares               -qc ~/qc_singleSubj -qc-seg dmri_dwi_mean_seg.nii.gz
--
Spinal Cord Toolbox (6.4)

sct_dmri_moco -i dmri.nii.gz -m mask_dmri_dwi_mean.nii.gz -bvec bvecs.bvec -param MeanSquares -qc /home/siying/qc_singleSubj -qc-seg dmri_dwi_mean_seg.nii.gz
--

Traceback (most recent call last):
  File "/opt/sct/spinalcordtoolbox/scripts/sct_dmri_moco.py", line 233, in <module>
    main(sys.argv[1:])
  File "/opt/sct/spinalcordtoolbox/scripts/sct_dmri_moco.py", line 203, in main
    param.update(arguments.param)
  File "/opt/sct/spinalcordtoolbox/moco.py", line 93, in update
    setattr(self, obj[0], obj[1])
IndexError: list index out of range

Then, i tried to use another metric: -param CC
--
Spinal Cord Toolbox (6.4)

sct_dmri_moco -i dmri.nii.gz -m mask_dmri_dwi_mean.nii.gz -bvec bvecs.bvec -param CC -qc /home/siying/qc_singleSubj -qc-seg dmri_dwi_mean_seg.nii.gz
--

Traceback (most recent call last):
  File "/opt/sct/spinalcordtoolbox/scripts/sct_dmri_moco.py", line 233, in <module>
    main(sys.argv[1:])
  File "/opt/sct/spinalcordtoolbox/scripts/sct_dmri_moco.py", line 203, in main
    param.update(arguments.param)
  File "/opt/sct/spinalcordtoolbox/moco.py", line 93, in update
    setattr(self, obj[0], obj[1])
IndexError: list index out of range


Last,  i tried to use another metric: -g 5
sct_dmri_moco -i dmri.nii.gz -m mask_dmri_dwi_mean.nii.gz -bvec bvecs.bvec -g 5 -qc 
Spinal Cord Toolbox (6.4)

sct_dmri_moco -i dmri.nii.gz -m mask_dmri_dwi_mean.nii.gz -bvec bvecs.bvec -g 5 -qc /home/siying/qc_singleSubj -qc-seg dmri_dwi_mean_seg.nii.gz
--


Input parameters:
  Input file ............ dmri.nii.gz
  Group size ............ 5
Creating temporary folder (/tmp/sct_2024-11-03_18-40-28_moco-wrapper_vwuer8qu)

Copying input data to tmp folder and convert to nii...

Get dimensions of data...
  192 x 192 x 70

Data orientation: RPI
  Treated as axial

Set suffix of transformation file name, which depends on the orientation:
Orientation is axial, suffix is 'Warp.nii.gz'. The estimated transformation is a 3D warping field, which is composed of a stack of 2D Tx-Ty transformations

Identify b=0 and DWI images...
  WARNING: bvecs file is 3xn instead of nx3. Consider using sct_dmri_transpose_bvecs.
  Transpose bvecs...
  Number of b=0: 1 [0]
  Number of DWI: 60 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60]

Split along T dimension...

Merge and average b=0 data...
Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:   0%|                             | 0/12 [00:00<?, ?iter/s]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:   8%|β–ˆβ–Š                   | 1/12 [00:01<00:12,  1.16s/iter]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  17%|β–ˆβ–ˆβ–ˆβ–Œ                 | 2/12 [00:02<00:11,  1.13s/iter]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  25%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž               | 3/12 [00:03<00:10,  1.14s/iter]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  33%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ              | 4/12 [00:04<00:08,  1.12s/iter]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  42%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š            | 5/12 [00:05<00:07,  1.11s/iter]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  50%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ          | 6/12 [00:06<00:06,  1.13s/iter]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  58%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž        | 7/12 [00:07<00:05,  1.15s/iter]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  67%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ       | 8/12 [00:09<00:04,  1.14s/iter]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  75%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š     | 9/12 [00:10<00:03,  1.14s/iter]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  83%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹   | 10/12 [00:11<00:02,  1.12s/iter]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups:  92%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž | 11/12 [00:12<00:01,  1.11s/iter]Image header specifies datatype 'int16', but array is of type 'float64'. Header metadata will be overwritten to use 'float64'.
Merge within groups: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 12/12 [00:13<00:00,  1.13s/iter]

Merge across groups...

-------------------------------------------------------------------------------
  Estimating motion on b=0 images...
-------------------------------------------------------------------------------

Input parameters:
  Input file ............ b0.nii
  Reference file ........ data_T0000.nii.gz
  Polynomial degree ..... 2
  Smoothing kernel ...... 1
  Gradient step ......... 1
  Metric ................ MI
  Sampling .............. None
  Todo .................. estimate_and_apply
  Mask  ................. mask.nii
  Output mat folder ..... mat_b0groups

Data dimensions:
  192 x 192 x 70 x 1

Copy file_target to a temporary file...

Register. Loop across Z (note: there is only one Z if orientation is axial)
Z=0/0:   0%|                                            | 0/1 [00:00<?, ?iter/s]
Traceback (most recent call last):
  File "/opt/sct/spinalcordtoolbox/scripts/sct_dmri_moco.py", line 233, in <module>
    main(sys.argv[1:])
  File "/opt/sct/spinalcordtoolbox/scripts/sct_dmri_moco.py", line 218, in main
    fname_output_image = moco_wrapper(param)
  File "/opt/sct/spinalcordtoolbox/moco.py", line 329, in moco_wrapper
    file_mat_b0, _ = moco(param_moco)
  File "/opt/sct/spinalcordtoolbox/moco.py", line 609, in moco
    failed_transfo[it] = register(param, file_data_splitZ_splitT[it], file_target_splitZ[iz], file_mat[iz][it],
  File "/opt/sct/spinalcordtoolbox/moco.py", line 753, in register
    status, output = run_proc(cmd, verbose=1 if param.verbose == 2 else 0, env=env, **kw)
  File "/opt/sct/spinalcordtoolbox/utils/sys.py", line 342, in run_proc
    raise RuntimeError(output)
RuntimeError: setting mask /tmp/sct_2024-11-03_18-40-28_moco-wrapper_vwuer8qu/mask.nii
Exception caught:
itk::ExceptionObject (0x58933b0)
Location: "unknown"
File: /__w/build_ANTs/build_ANTs/antsbin/staging/include/ITK-5.1/itkMattesMutualInformationImageToImageMetricv4.hxx
Line: 312
Description: itk::ERROR: MattesMutualInformationImageToImageMetricv4(0x4520be0): Joint PDF summed to zero

The specific error is:

Traceback (most recent call last):
  File "/opt/sct/spinalcordtoolbox/scripts/sct_dmri_moco.py", line 233, in <module>
    main(sys.argv[1:])
  File "/opt/sct/spinalcordtoolbox/scripts/sct_dmri_moco.py", line 218, in main
    fname_output_image = moco_wrapper(param)
  File "/opt/sct/spinalcordtoolbox/moco.py", line 329, in moco_wrapper
    file_mat_b0, _ = moco(param_moco)
  File "/opt/sct/spinalcordtoolbox/moco.py", line 609, in moco
    failed_transfo[it] = register(param, file_data_splitZ_splitT[it], file_target_splitZ[iz], file_mat[iz][it],
  File "/opt/sct/spinalcordtoolbox/moco.py", line 753, in register
    status, output = run_proc(cmd, verbose=1 if param.verbose == 2 else 0, env=env, **kw)
  File "/opt/sct/spinalcordtoolbox/utils/sys.py", line 342, in run_proc
    raise RuntimeError(output)
RuntimeError: setting mask /tmp/sct_2024-11-03_18-40-28_moco-wrapper_vwuer8qu/mask.nii
Exception caught:
itk::ExceptionObject (0x58933b0)
Location: "unknown"
File: /__w/build_ANTs/build_ANTs/antsbin/staging/include/ITK-5.1/itkMattesMutualInformationImageToImageMetricv4.hxx
Line: 312
Description: itk::ERROR: MattesMutualInformationImageToImageMetricv4(0x4520be0): Joint PDF summed to zero
  1. System information. (Please run the command β€œsct_check_dependencies” in your terminal, then copy and paste the output.)
 sct_check_dependencies

--
Spinal Cord Toolbox (6.4)

sct_check_dependencies
--


SYSTEM INFORMATION
------------------
SCT info:
- version: 6.4
- path: /opt/sct
OS: linux (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35)
CPU cores: Available: 12, Used by ITK functions: 12
RAM: Total: 7609MB, Used: 847MB, Available: 6502MB

OPTIONAL DEPENDENCIES
---------------------
Check FSLeyes version...............................[OK] (1.12.4)

MANDATORY DEPENDENCIES
----------------------
Check Python executable.............................[OK]
  Using bundled python 3.9.20 (main, Oct  3 2024, 07:27:41)
[GCC 11.2.0] at /opt/sct/python/envs/venv_sct/bin/python
Check if dipy is installed..........................[OK] (1.8.0)
/opt/sct/spinalcordtoolbox/scripts/sct_check_dependencies.py:164: UserWarning: Private repos not supported. Skipping.
  for req in requirements.parse(requirements_txt):
Check if ivadomed is installed......................[OK] (2.9.10)
Check if matplotlib is installed....................[OK] (3.9.1.post1)
Check if matplotlib-inline is installed.............[OK]
Check if monai is installed.........................[OK] (1.3.2)
Check if nibabel is installed.......................[OK] (5.2.1)
Check if nilearn is installed.......................[OK] (0.10.4)
Check if nnunetv2 (2.3.1) is installed..............[OK]
Check if numpy is installed.........................[OK] (1.26.4)
Check if onnxruntime is installed...................[OK] (1.18.1)
Check if pandas is installed........................[OK] (1.5.3)
Check if portalocker is installed...................[OK] (2.10.1)
Check if psutil is installed........................[OK] (6.0.0)
Check if pyqt5 (5.12.3) is installed................[OK] (5.12.3)
Check if pyqt5-sip is installed.....................[OK]
Check if pystrum is installed.......................[OK] (0.4)
Check if pytest is installed........................[OK] (8.3.2)
Check if pytest-cov is installed....................[OK] (5.0.0)
Check if requests is installed......................[OK] (2.32.3)
Check if requirements-parser is installed...........[OK] (0.10.2)
Check if scipy is installed.........................[OK] (1.13.1)
Check if scikit-image is installed..................[OK] (0.24.0)
Check if scikit-learn is installed..................[OK] (1.5.1)
Check if xlwt is installed..........................[OK] (1.3.0)
Check if tqdm is installed..........................[OK] (4.66.5)
Check if transforms3d is installed..................[OK] (0.4.2)
Check if urllib3 is installed.......................[OK] (2.2.2)
Check if pytest_console_scripts is installed........[OK]
Check if pyyaml is installed........................[OK] (6.0.2)
Check if voxelmorph is installed....................[OK] (0.2)
Check if wquantiles is installed....................[OK] (0.4)
Check if xlsxwriter is installed....................[OK] (3.2.0)
Check if spinalcordtoolbox is installed.............[OK]
Check ANTs compatibility with OS ...................[OK]
Check PropSeg compatibility with OS ................[OK]
Check if figure can be opened with PyQt.............[OK]
Check if figure can be opened with matplotlib.......[OK] (Using GUI backend: 'qtagg')
Check data dependency 'PAM50'.......................[OK]
Check data dependency 'deepseg_gm_models'...........[OK]
Check data dependency 'deepseg_sc_models'...........[OK]
Check data dependency 'deepseg_lesion_models'.......[OK]
Check data dependency 'deepreg_models'..............[OK]
Check data dependency 'PAM50_normalized_metrics'....[OK]
Check data dependency 'binaries_linux'..............[OK]
  1. File upload. (Please upload any data or scripts needed to reproduce your issue, if there are any.) β†’
    bvecs.bvec (1.6 KB)
    bvals.bval (303 Bytes)

Hi @xxxxx,

Thank you for reporting this issue, and our apologies for the late reply.

I have found one additional report of this exact error here:

This is caused by a lack of overlap between src and dest images [...] and in this case there is only very few voxels available to compute mutual information (e.g. if you try with -param metric=CC it won’t crash, but this is irrelevant anyway because this registration is based on a wrongly oriented data).

You could try using -param metric=CC as recommended above, but I suspect that something else is wrong here (e.g. the segmentation).

If you are able, could you please share the image data (dmri.nii.gz, mask_dmri_dwi_mean.nii.gz) so that we can double-check the quality of the segmentation? (cc: @jcohenadad)

Kind regards,
Joshua

Thank you for your reply!I am glad to share the image data,but that data is too big,i cannot upload. May I ask for your email address? I would be happy to send it to you by email. Thank you.

1 Like

Please feel free to send to joshua.newton@polymtl.ca. (This is my work email with the university that created SCT: https://neuro.polymtl.ca/)

I have already sent the image data to you via email. :grinning:

My apologies, but I have not received an email from you. It is possible that it got caught by the university’s spam filter. Could you please try the email joshuacwnewton@gmail.com instead?

Hi @xxxxx,

I have received your email. I hope it is OK, but just to help other people on the forum, I would like to share part of what you wrote:

I checked the DeepSeg segmentation data, and there is indeed an issue with the segmentation. How should I handle this poor segmentation? Should I manually erase the poorly segmented areas or use the task seg_sc_contrast_agnostic option?

I think both ideas are good! I would definitely start with the β€œcontrast agnostic” segmentation, and if that still fails, then manual correction of the segmentation may be necessary.

If you still need assistance, please let us know, and I would be happy to offer further suggestions.

Kind regards,
Joshua

1 Like

Thank you for your prompt response and helpful suggestions. I truly appreciate your feedback and the time you’ve taken to look into the segmentation issue.

1 Like

β€œAnother question: regarding the gray matter segmentation, I don’t have the T2* sequence. Can I use T2 for gray matter segmentation instead? Or in other words, how can I calculate gray matter volume if I don’t have the T2* sequence?”

Another question: regarding the gray matter segmentation, I don’t have the T2* sequence. Can I use T2 for gray matter segmentation instead?

In general, it is quite difficult to obtain a satisfactory WM/GM contrast in the cord with a spin echo sequence. But as always with MRI, it depends on the other acquisition parameters (eg: the use of off resonance pulses, inversion recovery pulses, etc.). So the rule of thumb here is: if you see a WM/GM contrast, they you should be able to use sct_deepseg_gm. If not, don’t use it.

Thank you for your timely response! When I was studying the SCT course, I saw this sentence: β€˜These files can be used to compute metrics for different regions of the spinal cord. For further details on the template itself, visit the PAM50 Template page’ (as shown in the image). Does this mean that I can use this to extract grey matter volume or white matter volume?

When I was studying the SCT course, I saw this sentence: β€˜These files can be used to compute metrics for different regions of the spinal cord. For further details on the template itself, visit the PAM50 Template page’ (as shown in the image). Does this mean that I can use this to extract grey matter volume or white matter volume?

This question is diverging quite significantly from the original post, which has to do with β€œERROR: sct_dmri_moco on SCT v6.4.0” (the title of this thread). It is very important to stick to the topic of each thread, otherwise some important questions might be hard to find through the search module. Can you please repost your previous question in a new, specific, thread, with the appropriate title, and we will answer there. Thank you for your understanding.

1 Like

Apologies for the off-topic question,I will repost my question in a new thread with the appropriate title.