You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to apply sct_image -i fullWarp_abs.nii.gz -display-warp to the warping field (fullWarp_abs.nii.gz) used for correction of gradient nonlinearities (gradient_unwarp.py). I got this error:
(venv_sct) sabeda@DESKTOP-JQ8A4UV:/mnt/c/Users/sb199/Projet3_data$ sct_image -i warping_field/fullWarp_abs.nii.gz -display-warp--Spinal Cord Toolbox (git-jca/3336-display-warp-7de29b49e9979eb22409e8a11eb2c79eb0277281)sct_image -i warping_field/fullWarp_abs.nii.gz -display-warp--Creating temporary folder (/tmp/sct-20210407144012.007017-jex9nz5p)sct_resample -i grid_3.nii.gz -f 3x3x1 -x nn -o grid_3_resample.nii.gz # in /tmp/sct-20210407144012.007017-jex9nz5psct_apply_transfo -i /tmp/sct-20210407144012.007017-jex9nz5p/grid_3_resample.nii.gz -d /tmp/sct-20210407144012.007017-jex9nz5p/grid_3_resample.nii.gz -w /mnt/c/Users/sb199/Projet3_data/warping_field/fullWarp_abs.nii.gz -o /mnt/c/Users/sb199/Projet3_data/warping_field/grid_3_resample_fullWarp_abs.nii.gz # in /mnt/c/Users/sb199/Projet3_dataTraceback (most recent call last): File "/mnt/c/Users/sb199/spinalcordtoolbox/spinalcordtoolbox/scripts/sct_image.py", line 554, in <module> main(sys.argv[1:]) File "/mnt/c/Users/sb199/spinalcordtoolbox/spinalcordtoolbox/scripts/sct_image.py", line 233, in main visualize_warp(im_warp=im_in, im_grid=None, step=3, rm_tmp=True) File "/mnt/c/Users/sb199/spinalcordtoolbox/spinalcordtoolbox/scripts/sct_image.py", line 547, in visualize_warp run_proc(['sct_apply_transfo', '-i', fname_grid, '-d', fname_grid, '-w', fname_warp, '-o', grid_warped]) File "/mnt/c/Users/sb199/spinalcordtoolbox/spinalcordtoolbox/utils/sys.py", line 320, in run_proc raise RuntimeError(output)RuntimeError:--Spinal Cord Toolbox (git-jca/3336-display-warp-7de29b49e9979eb22409e8a11eb2c79eb0277281)sct_apply_transfo -i /tmp/sct-20210407144012.007017-jex9nz5p/grid_3_resample.nii.gz -d /tmp/sct-20210407144012.007017-jex9nz5p/grid_3_resample.nii.gz -w /mnt/c/Users/sb199/Projet3_data/warping_field/fullWarp_abs.nii.gz -o /mnt/c/Users/sb199/Projet3_data/warping_field/grid_3_resample_fullWarp_abs.nii.gz--Parse list of warping fields...Traceback (most recent call last):File "/mnt/c/Users/sb199/spinalcordtoolbox/spinalcordtoolbox/scripts/sct_apply_transfo.py", line 365, in <module>main(sys.argv[1:])File "/mnt/c/Users/sb199/spinalcordtoolbox/spinalcordtoolbox/scripts/sct_apply_transfo.py", line 360, in maintransform.apply()File "/mnt/c/Users/sb199/spinalcordtoolbox/spinalcordtoolbox/scripts/sct_apply_transfo.py", line 169, in apply.format(path_warp))ValueError: Displacement field in /mnt/c/Users/sb199/Projet3_data/warping_field/fullWarp_abs.nii.gz is invalid: should be encoded in a 5D file with vector intent code (see https://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1.h
I tested sct_image -display-warp with a warping field created with sct_register_multimodal and everything worked.
So I think fullWarp_abs.nii.gz follows FSL convention and not ITK, it has only 4 dimensions.
Maybe not worth the trouble for just displaying the grid with the warping field.
The file is in : duke/temp/sebeda/data_warping_field/fullWarp_abs.nii.gz
The text was updated successfully, but these errors were encountered:
I did not figure out how to convert the warping field in the ITK format to make it compatible with sct_image -display-warp but, I figured out that fullWarp_abs.nii.gz is a volume of coefficient, so to have the field, I ran :
And on ITK-SNAP, when clicking on multi-component display --> grid I get this:
Well, it is not as nice as the output of sct_image -display-warp but, from what I observed, the grid is only in the axial view, I think having the sagittal view for the warping field may be better here, maybe we ca do something with that image instead.
So I think fullWarp_abs.nii.gz follows FSL convention and not ITK, it has only 4 dimensions.
yup! you figured this out. As you probably noticed we have a sct_image -to-fsl feature, but no sct_image -to-itk 😬
However, your investigation in #59 (comment) is excellent, and i think largely sufficient if the goal is simply to export a nice-looking image to illustrate gradient non-linearity correction in the pipeline figure of your article
However, your investigation in #59 (comment) is excellent, and i think largely sufficient if the goal is simply to export a nice-looking image to illustrate gradient non-linearity correction in the pipeline figure of your article
Description
I wanted to apply
sct_image -i fullWarp_abs.nii.gz -display-warp
to the warping field (fullWarp_abs.nii.gz
) used for correction of gradient nonlinearities (gradient_unwarp.py). I got this error:I tested
sct_image -display-warp
with a warping field created withsct_register_multimodal
and everything worked.So I think
fullWarp_abs.nii.gz
follows FSL convention and not ITK, it has only 4 dimensions.Maybe not worth the trouble for just displaying the grid with the warping field.
The file is in :
duke/temp/sebeda/data_warping_field/fullWarp_abs.nii.gz
The text was updated successfully, but these errors were encountered: