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
- 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]
- 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)