Registration of template to DWI

Hi Julien,

I have some DWI data and need to do all related quantifications using SCT. I exactly run all the commands related to DWI, but it seems that in the registration part, it cannot register the template to DWI (maybe because of cropping, although I tried it without cropping, the registration result did not change). I tried to change the -param flag’s settings as well, changed the algorithms, iterations, slicewise, no slicewise, and everything that I thought might change the result. but it just cannot get properly registered. It shows me the result, but it is not correct. I would really appreciate it if you can guide me and suggest anything that can make it work. I tried whatever I could, but did not reach the proper result for DWI data.
P.S. I attached the figure that I see in the registration stage.

Thank you very much.

1 Like

Hi @Maryam,

Thank you for reaching out. Easiest would be for you to share the relevant data, as well as your processing script that led you to these results, and the SCT version you are running.

If you prefer to not publicly share the data you can email me a private download link.

Cheers,
Julien

Thank you very much Julien. I shared a link with you. I would really appreciate if you can add any point to solve this issue.

Regards,
Maryam

Hi Maryam,

I had a look at what you sent-- a few comments:

  • the script should be a shell file (not txt), and by running this script i should be able to reproduce exactly what you did. This is currently not possible because the syntax inside the script does not match your folder/file naming structure;
  • along with the previous point: please organize your data under the BIDS convention. See example here;
  • please let me know which sct version you are running
  • please add your SCT QC report in the package you want me to look at (use -qc flag with your SCT commands)

Best,
Julien

Hi Julien,

I updated the link and sent it. All your points are considered now. Just by running the shell file, the results will be produced. To make it easier to check, I just included the name of the first dwi image in the shell file. But it can be edited for other images too. Thank you so much for taking your time.

Regards,
Maryam

Hi Maryam,

  • The QC folder you sent me was empty,
  • Please let me know which version of SCT you are running,
  • line 19 of your script:
sct_register_multimodal -i $SCT_DIR/data/PAM50/template/PAM50_t1.nii.gz -iseg $SCT_DIR/data/PAM50/template/PAM50_cord.nii.gz -d dmri_crop_moco_dwi_mean.nii.gz -dseg dmri_crop_moco_dwi_mean_seg.nii.gz -param step=1,type=seg,algo=centermass:step=2,type=seg,algo=bsplinesyn,slicewise=1,iter=3 -initwarp $SCT_DIR/sct_example_data/t2s/warp_template2t2s.nii.gz -initwarpinv $SCT_DIR/sct_example_data/t2s/warp_t2s2template.nii.gz -qc ./qc

This will not work because you are inputing a warping field which comes from another dataset (sct_example_data). You need to estimate a warping field between the PAM50 template and your subject (via an anatomical scan of your subject), and then input it here. I recommend you look at the processing script for the spine-generic project, which explains all this.

Also: the script you sent me cannot properly be run across multiple subjects because subject’s folder is hard-coded in the script. I strongly recommend you make your script subject-agnostic (which is the purpose of the BIDS convention). That way you will be able to run processing across 500 subjects with only one script (vs. 500 scripts, which is more difficult to maintain).

To help you, I’ve made a script that does the first part of the DWI processing. The rest of the processing (registration to template) will need to be figured out based on the other data you have (anatomical). Here it is: scripts_20200420152855.zip (2.4 KB)
After unzipping, move those scripts in the directory that encloses your folder dataset, then run:

sct_run_batch parameters.sh process_dwi.sh

Note that the script fails for subject sub-c2, which does not follow the convention (i.e., the dwi data should be called “sub-c2_dwi.nii.gz”, not “sub-c2_run-XX_dwi.nii.gz”).

Cheers,
Julien

2 Likes

Hi Julien,

Thank you very much for your guidance. As you pointed out, I estimated the warping field between the PAM50 template and my subject through an anatomical scan of my subject, and the registration now seems good.
Yes, I will make my script subject-agnostic to be able to run multiple processing with it.
Also, I am using SCT version 4.2.1.

Regards,
Maryam

2 Likes