Compute DTI metrics

Hi everyone
If the number of layers of T2S is inconsistent with that of DTI, will it affect the calculation of DTI value?

hi,

by “layers”, do you mean “axial slice”?
if so, by “calculation of DTI value”, do you mean: “estimation of voxelwise metrics using the DTI model”? If so, no, the number of axial slices on the T2s will not affect the calculation of the voxelwise DTI metric (which, de facto, are donc on the DWI data, not on the T2s data).

If you use the T2s data as an intermediate step for registration of the DWI data to the template, then the number of slices could have an impact on the aggregation of DTI metrics.

This is a fairly high-level question, which IMHO requires a deeper understanding of the overall technologies and methods which are involved. I encourage you to read more about the DWI/DTI methods in general.

I hope that help,

Cheers
Julien

Hi
Yes ,I start the registration from the previously-registered template—>t2s,so the number of slices could have an impact on the aggregation of DTI metrics?
And If I don’t have a T2 and T2S scan and only have DTI scan, can I still compute DTI metrics ?how do we do that?

Yes ,I start the registration from the previously-registered template—>t2s,so the number of slices could have an impact on the aggregation of DTI metrics?

It depends on multiple factors (positioning of the relative FOVs, where you compute the aggregation of metrics, etc.).

And If I don’t have a T2 and T2S scan and only have DTI scan, can I still compute DTI metrics ?how do we do that?

Yes you can. See e.g. this pipeline.

Hi julien
I took your advice and compute DTI metrics by above pipeline.I only have DTI files. But there are some problems.

(venv_sct) forest@DESKTOP-DM8SQ21:~/multiparametric-fixed-fov-master$ ./run_process.sh 1_process_data.sh
parameters.sh: line 16: slbp_001p: command not found
parameters.sh: line 17: SLBP_002: command not found
parameters.sh: line 18: slbp_004: command not found
parameters.sh: line 19: slbp_005: command not found
parameters.sh: line 20: slbp_006: command not found
parameters.sh: line 21: syntax error near unexpected token `)'
parameters.sh: line 21: `       )'
./run_process.sh: line 46: cd: /Users/forest/data: No such file or directory
Processing all subjects present in: /Users/forest/data.

===============================
PROCESSING SUBJECT: fig/
===============================
  /home/forest/multiparametric-fixed-fov-master/1_process_data.sh: line 15: cd: mt: No such file or directory

--
Spinal Cord Toolbox (git-HEAD-95e66208c9d6937fbe00e86db6176e4001196e56)

sct_propseg -i mt1.nii.gz -c t2
--

Traceback (most recent call last):
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/forest/multiparametric-fixed-fov-master/fig/mt1.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_propseg.py", line 678, in <module>
    main(sys.argv[1:])
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_propseg.py", line 664, in main
    img_input = Image(fname_input_data)
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 283, in __init__
    self.loadFromPath(param, verbose)
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 404, in loadFromPath
    self.im_file = nib.load(path)
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError(f"No such file or no access: '{filename}'")
FileNotFoundError: No such file or no access: '/home/forest/multiparametric-fixed-fov-master/fig/mt1.nii.gz'

FSLeyes will now open. Check the segmentation. If necessary, manually adjust the segmentation and then save it as: mt1_seg_manual.nii.gz. Close FSLeyes when you're finished, go back to the Terminal and press any key to continue...unrecognized arguments: mt1.nii.gz -cm greyscale mt1_seg.nii.gz -cm red -a 70.0

FSLeyes version 0.32.3

Usage: fsleyes [options] file [displayOpts] file [displayOpts] ...

--
Spinal Cord Toolbox (git-HEAD-95e66208c9d6937fbe00e86db6176e4001196e56)

sct_create_mask -i mt1.nii.gz -p centerline,mt1_seg.nii.gz -size 35mm
--


ERROR: The file mt1_seg.nii.gz does not exist. Exit program.

Creating temporary folder (/tmp/sct-20210320170527.723237-create_mask-6axs788h)

Orientation:
Traceback (most recent call last):
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/forest/multiparametric-fixed-fov-master/fig/mt1.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_create_mask.py", line 358, in <module>
    main(sys.argv[1:])
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_create_mask.py", line 153, in main
    create_mask(param)
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_create_mask.py", line 177, in create_mask
    orientation_input = Image(param.fname_data).orientation
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 283, in __init__
    self.loadFromPath(param, verbose)
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 404, in loadFromPath
    self.im_file = nib.load(path)
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError(f"No such file or no access: '{filename}'")
FileNotFoundError: No such file or no access: '/home/forest/multiparametric-fixed-fov-master/fig/mt1.nii.gz'

--
Spinal Cord Toolbox (git-HEAD-95e66208c9d6937fbe00e86db6176e4001196e56)

sct_crop_image -i mt1.nii.gz -m mask_mt1.nii.gz -o mt1_crop.nii.gz
--

Traceback (most recent call last):
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'mt1.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_crop_image.py", line 180, in <module>
    main(sys.argv[1:])
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_crop_image.py", line 148, in main
    cropper = ImageCropper(Image(arguments.i))
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 283, in __init__
    self.loadFromPath(param, verbose)
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 404, in loadFromPath
    self.im_file = nib.load(path)
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError(f"No such file or no access: '{filename}'")
FileNotFoundError: No such file or no access: 'mt1.nii.gz'

--
Spinal Cord Toolbox (git-HEAD-95e66208c9d6937fbe00e86db6176e4001196e56)

sct_register_multimodal -i mt0.nii.gz -d mt1_crop.nii.gz -param step=1,type=im,algo=rigid,slicewise=1,metric=CC -x spline
--


Input parameters:
  Source .............. mt0.nii.gz
  Destination ......... mt1_crop.nii.gz
  Init transfo ........
  Mask ................
  Output name .........
  Remove temp files ... 1
  Verbose ............. 1

Check if input data are 3D...
Traceback (most recent call last):
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'mt0.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_register_multimodal.py", line 430, in <module>
    main(sys.argv[1:])
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_register_multimodal.py", line 385, in main
    check_dim(fname_src, dim_lst=[3])
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 1467, in check_dim
    dim = Image(fname).hdr['dim'][:4]
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 283, in __init__
    self.loadFromPath(param, verbose)
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 404, in loadFromPath
    self.im_file = nib.load(path)
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError(f"No such file or no access: '{filename}'")
FileNotFoundError: No such file or no access: 'mt0.nii.gz'

--
Spinal Cord Toolbox (git-HEAD-95e66208c9d6937fbe00e86db6176e4001196e56)

sct_register_multimodal -i t1w.nii.gz -d mt1_crop.nii.gz -param step=1,type=im,algo=rigid,slicewise=1,metric=CC -x spline
--


Input parameters:
  Source .............. t1w.nii.gz
  Destination ......... mt1_crop.nii.gz
  Init transfo ........
  Mask ................
  Output name .........
  Remove temp files ... 1
  Verbose ............. 1

Check if input data are 3D...
Traceback (most recent call last):
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 't1w.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_register_multimodal.py", line 430, in <module>
    main(sys.argv[1:])
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_register_multimodal.py", line 385, in main
    check_dim(fname_src, dim_lst=[3])
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 1467, in check_dim
    dim = Image(fname).hdr['dim'][:4]
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 283, in __init__
    self.loadFromPath(param, verbose)
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 404, in loadFromPath
    self.im_file = nib.load(path)
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError(f"No such file or no access: '{filename}'")
FileNotFoundError: No such file or no access: 't1w.nii.gz'

ERROR: Neither MIDFOV_DISC nor MIDFOV_VERT field is active. Please see README.md. Exiting.


===============================
PROCESSING SUBJECT: label/
===============================
  /home/forest/multiparametric-fixed-fov-master/1_process_data.sh: line 15: cd: mt: No such file or directory

--
Spinal Cord Toolbox (git-HEAD-95e66208c9d6937fbe00e86db6176e4001196e56)

sct_propseg -i mt1.nii.gz -c t2
--

Traceback (most recent call last):
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/forest/multiparametric-fixed-fov-master/label/mt1.nii.gz'
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_propseg.py", line 678, in <module>
    main(sys.argv[1:])
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_propseg.py", line 664, in main
    img_input = Image(fname_input_data)
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 283, in __init__
    self.loadFromPath(param, verbose)
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 404, in loadFromPath
    self.im_file = nib.load(path)
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError(f"No such file or no access: '{filename}'")
FileNotFoundError: No such file or no access: '/home/forest/multiparametric-fixed-fov-master/label/mt1.nii.gz'

FSLeyes will now open. Check the segmentation. If necessary, manually adjust the segmentation and then save it as: mt1_seg_manual.nii.gz. Close FSLeyes when you're finished, go back to the Terminal and press any key to continue...unrecognized arguments: mt1.nii.gz -cm greyscale mt1_seg.nii.gz -cm red -a 70.0

FSLeyes version 0.32.3

Usage: fsleyes [options] file [displayOpts] file [displayOpts] ...

--
Spinal Cord Toolbox (git-HEAD-95e66208c9d6937fbe00e86db6176e4001196e56)

sct_create_mask -i mt1.nii.gz -p centerline,mt1_seg.nii.gz -size 35mm
--


ERROR: The file mt1_seg.nii.gz does not exist. Exit program.

Creating temporary folder (/tmp/sct-20210320170536.749137-create_mask-5zctemnm)

Orientation:
Traceback (most recent call last):
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/forest/multiparametric-fixed-fov-master/label/mt1.nii.gz'
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_create_mask.py", line 358, in <module>
    main(sys.argv[1:])
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_create_mask.py", line 153, in main
    create_mask(param)
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_create_mask.py", line 177, in create_mask
    orientation_input = Image(param.fname_data).orientation
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 283, in __init__
    self.loadFromPath(param, verbose)
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 404, in loadFromPath
    self.im_file = nib.load(path)
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError(f"No such file or no access: '{filename}'")
FileNotFoundError: No such file or no access: '/home/forest/multiparametric-fixed-fov-master/label/mt1.nii.gz'

--
Spinal Cord Toolbox (git-HEAD-95e66208c9d6937fbe00e86db6176e4001196e56)

sct_crop_image -i mt1.nii.gz -m mask_mt1.nii.gz -o mt1_crop.nii.gz
--

Traceback (most recent call last):
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'mt1.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_crop_image.py", line 180, in <module>
    main(sys.argv[1:])
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_crop_image.py", line 148, in main
    cropper = ImageCropper(Image(arguments.i))
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 283, in __init__
    self.loadFromPath(param, verbose)
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 404, in loadFromPath
    self.im_file = nib.load(path)
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError(f"No such file or no access: '{filename}'")
FileNotFoundError: No such file or no access: 'mt1.nii.gz'

--
Spinal Cord Toolbox (git-HEAD-95e66208c9d6937fbe00e86db6176e4001196e56)

sct_register_multimodal -i mt0.nii.gz -d mt1_crop.nii.gz -param step=1,type=im,algo=rigid,slicewise=1,metric=CC -x spline
--


Input parameters:
  Source .............. mt0.nii.gz
  Destination ......... mt1_crop.nii.gz
  Init transfo ........
  Mask ................
  Output name .........
  Remove temp files ... 1
  Verbose ............. 1

Check if input data are 3D...
Traceback (most recent call last):
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'mt0.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_register_multimodal.py", line 430, in <module>
    main(sys.argv[1:])
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_register_multimodal.py", line 385, in main
    check_dim(fname_src, dim_lst=[3])
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 1467, in check_dim
    dim = Image(fname).hdr['dim'][:4]
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 283, in __init__
    self.loadFromPath(param, verbose)
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 404, in loadFromPath
    self.im_file = nib.load(path)
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError(f"No such file or no access: '{filename}'")
FileNotFoundError: No such file or no access: 'mt0.nii.gz'

--
Spinal Cord Toolbox (git-HEAD-95e66208c9d6937fbe00e86db6176e4001196e56)

sct_register_multimodal -i t1w.nii.gz -d mt1_crop.nii.gz -param step=1,type=im,algo=rigid,slicewise=1,metric=CC -x spline
--


Input parameters:
  Source .............. t1w.nii.gz
  Destination ......... mt1_crop.nii.gz
  Init transfo ........
  Mask ................
  Output name .........
  Remove temp files ... 1
  Verbose ............. 1

Check if input data are 3D...
Traceback (most recent call last):
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 't1w.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_register_multimodal.py", line 430, in <module>
    main(sys.argv[1:])
  File "/home/forest/sct/spinalcordtoolbox/scripts/sct_register_multimodal.py", line 385, in main
    check_dim(fname_src, dim_lst=[3])
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 1467, in check_dim
    dim = Image(fname).hdr['dim'][:4]
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 283, in __init__
    self.loadFromPath(param, verbose)
  File "/home/forest/sct/spinalcordtoolbox/image.py", line 404, in loadFromPath
    self.im_file = nib.load(path)
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError(f"No such file or no access: '{filename}'")
FileNotFoundError: No such file or no access: 't1w.nii.gz'

ERROR: Neither MIDFOV_DISC nor MIDFOV_VERT field is active. Please see README.md. Exiting.

this is my parameters.sh file.
parameters.sh (1.1 KB)

And my file structure


Do you know what the problem is?
Thanks!

The problem is that you are using a parameters.sh file that does not correspond to your folder organization. The link to the " multiparametric-fixed-fov repository I indicated was to get inspiration from (ie: understand it, and then copy the bits that fit your analysis), not to copy it verbatim.

As I already mentioned in the past, there are fundamental aspects (shell scripting, neuroimaging concepts, etc.) that need to be understood before diving into the analysis. Which is why I recommended you spend time (weeks, months if necessary) to go through the SCT course. Unfortunately I do not have the time to guide you through these basics. Is there anyone at your center who could help with these aspects?

Hi jcohenadad
Thank you very much for your advice and guidance!
I do not work in any center, I am a clinician, all the image collection and analysis is done by myself. So I didn’t know the basics very well, and no one helped me. I don’t really understand the code or the Linux system, I learned about the software in the paper. I watched your video in London and I didn’t understand a lot of it. I will spend more time on SCT course in the future.
Cheers
Chang

Hi Chang,
Thank you for sharing your background, I understand better now. Indeed, it is normal that you don’t perfectly grasp all steps of the analysis pipeline, don’t worry about it. I do admire your motivation to learn more about the technical aspects. Please feel free to reach out if there are things specific to SCT that are unclear in the course material.
Kind regards,
Julien