This is likely a naive question, but I wanted to know if I could easily extract the anterior-posterior and left-right diameters from the PAM50 template at each segment of the cord (C1-L2)?
You can use the
sct_process_segmentation function to compute shape metrics for segmentations (this includes the AP/LR diameters).
# Go into the PAM50 template folder cd $SCT_DIR/data/PAM50/template # Compute shape metrics sct_process_segmentation -i PAM50_cord.nii.gz -vert 1:20 -vertfile PAM50_levels.nii.gz -perlevel 1 -o metrics_perlevel.csv # -i: The input segmentation. # -vert: Specify the region (vert level range) that you want to compute metrics over # (NB: 1:20 corresponds to C1 to T12) # -vertfile: Provide a file (separate from the cord segmentation) # that contains vertebral level information # -perlevel: Specify that you want the metrics to be output on a per-level basis # (as opposed to aggregated across the entire region of interest)
This will give you an output csv file that contains the following columns:
(Note that the CSV file is ordered from inferior → superior slice, but of course this can be reordered in Excel/Google Sheets/etc.)
Please let us know if you have any other questions.
One small note: The above command is just is for the unmodified PAM50 template.
If you would like to compute metrics for a PAM50 template that has been registered with subject data, I recommend following the first 3 sections of the “Registration to template” tutorial, which gives an overview of the typical “registration → metric computation” processing pipeline.
Thanks, @joshuacwnewton! This is very helpful!
One question: Can I compute these shape parameters past T12 (ie into the lumbar spinal cord)? In other words, can the vert parameter go beyond the 1:20 in the example you showed?
Unfortunately, the spinal cord segmentation contained within the PAM50 template does not extend into the lumbar section:
(You can also open the
PAM50_levels.nii.gz file in the image viewer of your choice (e.g.
fsleyes) to double-check. Here, the labeled cord segmentation stops at label 20.)
Thanks! As background, we have lesions mapped onto paper templates which represent a standard space of the cervical, thoracic, and lumbar regions (attached here for reference):
I am hoping to perform distance-based voxel-wise lesion segmentation like this paper: 7 T imaging reveals a gradient in spinal cord lesion distribution in multiple sclerosis | Brain | Oxford Academic
However, in order to do so, I was hoping to have an understanding of the average shape parameters of the cervical, thoracic, and lumbar spinal cord regions. Any thoughts on another way I may get this type of information if the PAM50 stops before the lumbar region?
Thank you for reaching out. Joshua already provided excellent information about how to compute shape analysis along the superior-inferior axis. Let me add a few comments.
First off, I understand you wish to compute lesion mapping topography statistics at the cervical, thoracic and lumbar spinal levels. So, while the PAM50 indeed extents to the L2 vertebral levels, the whole lumbar spinal levels are covered by the PAM50 template (since in adults, the cauda equinea starts around L2-L3 vertebrae). So you can use the PAM50 for this analysis.
Now, if you’d like to perform distance-based voxel-wise lesion analysis as in the Ouellette et al. paper, I recommend starting off from the code which was used to process the spinal cord data. If you need any help with that code, please feel free to open an issue.
I hope that helps!
Thanks, @jcohenadad! This code will be very helpful!
I think I was more referring to something upstream. We hand drew lesion topography onto paper templates (images attached above) from histological images rather than performing spinal cord MRI. Therefore, since we can’t directly compare voxels on our paper template with in-vivo scan voxels due to size differences, I was trying to find a way of equating the bin-widths used in the MRI study with something on our templates to keep things consistent and thought having an understanding of shape parameters at each level (cervical, thoracic, and lumbar) would allow for the calculation of our template voxelsize and hence end up with bin-widths as close as possible to the MRI study? Not sure if there is another way of doing this? I could potentially use size estimates from this paper: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5179522/#B23
One possibility would be to select a slice in the PAM50 template that corresponds to the matching cervical, thoracic and lumbar levels from your paper template. Then, perform a non-linear registration as illustrated in this image below:
This non-linear registration will produce a transformation, which can then be applied to individual MS lesion mapping (ie: each individual) to bring them from the “Paper space” to the “PAM50 space”. I would be happy to help you find the non-linear registration parameter, as this can be a tricky process.
You could also do the same thing on a higher resolution exvivo template. Unfortunately, this exvivo template only covers the cervical cord, so it might not be suitable for your analysis. First, download the template:
sct_download_data -d exvivo_template
And then perform the slice-wise registration as explained above.