Registering fMRI data to the PAM50 template#

Now that we have the motion-corrected time-averaged fMRI image, we can use it to register the template to the fMRI image space. Usually, template registration would be performed using the sct_register_to_template command. That command is important because it matches the vertebral levels of the data to that of the PAM50 template. Unfortunately, though, because fMRI scans are typically acquired axially with thick slices, it is much more difficult to use sct_label_vertebrae to acquire the vertebral labels needed for the vertebral matching step.

To get around this limitation, we recommend that you first perform vertebral labeling and template registration using a different contrast for the same subject (e.g. T2 or T2* anatomical data, where vertebral levels are much more apparent). This will provide you with warping fields between the template and that contrast’s data, which you can then re-use to initialize the fMRI registration via the -initwarp and -initwarpinv flags. Doing so provides all of the benefits of vertebral matching, without having to label the fMRI data directly.

Since we are starting the fMRI registration with the vertebral-matching transformations already applied, all that remains is fine-tuning for the fMRI data. So, here we use a different command: sct_register_multimodal. This command is designed to register any two images together, so it can be seen as the generalized counterpart to sct_register_to_template.

sct_register_multimodal -i "${SCT_DIR}/data/PAM50/template/PAM50_t2s.nii.gz" \
                        -d fmri_moco_mean.nii.gz \
                        -dseg t2_seg_reg.nii.gz \
                        -param step=1,type=im,algo=syn,metric=CC,iter=5,slicewise=0 \
                        -initwarp ../t2s/warp_template2t2s.nii.gz \
                        -initwarpinv ../t2s/warp_t2s2template.nii.gz \
                        -owarp warp_template2fmri.nii.gz \
                        -owarpinv warp_fmri2template.nii.gz \
                        -qc ~/qc_singleSubj
Input arguments:
  • -i : Source image. Here, we select the T2* version of the PAM50 template, because the T2* contrast is the closest visual match to our fMRI data.

  • -d : Destination image. Here, we supply the motion-corrected mean image generated in the previous steps.

  • -dseg : Because we supply type=im to -param, this segmentation is not actually used during registration. The reason we supply -dseg anyway is because it will be used in the QC report to roughly crop around the cord, so that it can be better visualized.

  • -paramTypically, registration would be performed using a two-step process involving the spinal cord segmentation. However, since fMRI data cannot be segmented reliably, we need to tailor the settings for image-only registration.
    • type=im : Here, we rely on just the anatomical images (-i and -d) rather than segmentation images (-iseg and -dseg).

    • algo=syn : This algorithm helps to compensate for the the lack of segmentation during registration.

    • iter=5: We decrease the number of iterations (default 10), because the registration is sensitive to the artifacts in fMRI data. (Specifically, fMRI scans use gradient echo EPI (vs. spin echo EPI for dMRI), which is hampered by signal drop out caused by intra-voxel dephasing, in addition to the large susceptibility-related image distortions.)

  • -initwarp : A “source->destination” warping field (here, “template->data”), used to initialize the registration process. Here, we supply a previous warping field generated by sct_register_to_template, because we want to start out with a transformation that includes vertebral level matching.

  • -initwarpinv : A “destination->source” warping field (here, “data->template”), used to initialize the registration process. Here, we supply a previous warping field generated by sct_register_to_template, because we want to start out with a transformation that includes vertebral level matching.

  • -owarp: The name of the output warping field. This is optional, and is only specified here to make the output filename a little clearer. By default, the filename would be automatically generated from the filenames -i and -d, which in this case would be the (less clear) warp_PAM50_t2s2fmri_moco_mean.nii.gz.

  • -owarpinv : The name of the output inverse warping field. This is specified for the same reasons as -owarp.

  • -qc : Directory for Quality Control reporting. QC reports allow us to evaluate the results slice-by-slice.

Output files/folders:
  • PAM50_t2s_reg.nii.gz : The PAM50 template image, registered to the space of dMRI data.

  • fmri_moco_mean_reg.nii.gz : The mean fMRI image, registered to the space of the PAM50 template.

  • warp_template2fmri.nii.gz : The warping field to transform the PAM50 template to the fMRI space.

  • warp_fmri2template.nii.gz : The warping field to transform the fMRI data to the PAM50 template space.