Best practices for manually defining vertebral levels

Hi @jcohenadad!

I re-ran my preprocessing pipeline on a dataset that I previously processed a couple months ago, and noticed that the result was odd. (For cervical regions, my pipeline has the user define only label “3”.) Upon closer inspection (pic below), it was clear that the vertebral levels were stretched about 50% further than they should have been (shown on the right vs. a proper warping field from another subject on the left).

I am, of course, aware of this very helpful video showing the selection of multiple cervical vertebral levels:

… as well as this topic:

However, I had an issue just over a year ago with the warping of some thoracic data, and the solution was to define only two thoracic points instead of as many as possible (albeit with my error of overlabeling past “21”):

Therefore, I have to admit that I am uncertain as to what the best practices are for manually defining vertebral levels (hence the title of this post :slight_smile: ). There are examples of labeling all cervical levels (which I presume would fix the incorrect cervical warping field that I just observed), but there is also the issue with thoracolumbar labeling where the warping field was less “funky” when only two points were labeled (which, to be honest, I still don’t quite understand).

I am processing dozens of cervical or thoracolumbar datasets and my #1 wish, of course, is that the results are as accurate as possible (and stable across SCT versions). I have absolutely no problem manually defining each level for the cervical and thoracic scans if that is the best path forward for the results to be as accurate as possible; however, I didn’t write this code and don’t want to make assumptions (e.g., the issue of the thoracic warping field discussed previously). Would you be able to comment on the best practices for manually defining cervicothoracolumbar vertebral levels? Thanks! :slight_smile:


Hi @barryrl,

Excellent topic. I acknowledge this procedure can be confusing given the various possible approaches.

First of all, this straightening is definitely unexpected:

It is not surprising that automatic vertebral labeling, even with C2-C3 initialization, would produce bad results. I suspect there is something wrong with the qform/sform. Would you mind sending me the image + segmentation?

Now, addressing the best practices.

2-point vertebral body labels

Originally, for registration to a template, SCT advised to select two points at the level of the mid vertebral bodies, orthogonally projected in the spinal cord. These two points are to be selected so that the region of interest is between these two points. If ppl are studying C2-C5 levels, these two points should be at C2 and at C5. This will ensure scale the PAM50 template to match C2 and C5 levels, with an affine scaling in between. There could be some inaccuracies here, if the ratio across vertebral bodies slightly differs from that ratio on the template. However, as has been discussed in several papers and conferences, IMHO, this inaccuracy is negligible compared to the inaccuracy one makes by considering vertebral levels for accounting spinal levels at the first place. Moreover, spinal levels themselves also span across several mm (see e.g. Cadotte AJNR 2015). So, all in all, I really don’t think this variable inter-vertebrae ratio is a problem.

2+ labels

Now, coming back to my statement above, because as scientists we should be skeptical, what if the variable inter-vertebrae ratio is not negligible. SCT offers the possibility to account for the z-position of all labels during template registration. In this case, the first z-alignment is not affine, but non-affine. The implication is that there is no definition of the warping field above the top label and below the bottom label. This has caused problems for some users in the past (eg: “why is my image cropped?”), therefore we usually do not recommend this approach. However, being aware of the pros/cons, this approach is definitely possible and would indeed provide a more accurate registration of the template level-wise.

1 label

In some cases, the image only covers one vertebrae, or part of two vertebrae. For this scenario, SCT offers the possibility to register the PAM50 using one label only. In this case, there is no affine transformation applied. Only a z-translation to match the body (or disc) between the image and the template.

Body vs. disc labels

There is the possibility to label the vertebral body, or the discs. This decision does not significantly impact the performance of the registration. In some cases, users prefer to label the discs (easier to spot), so there is this possibility. In this case sct_register_to_template should be used with option -ldisc instead of -l.

Manual labeling vs. automatic labeling

Automatic labeling is usually preferred for reproducibility purpose, or for processing large databases. This is performed with sct_label_vertebrae. If initial identification of C2-C3 fails (e.g., bad quality data or C2-C3 not visible because thoraco-lumbar scans), there is the possibility to manually initialize one label, and then run sct_label_vertebrae with option -initlabel. If, despite this initial labeling, the semi-automatic method fails, then it is recommended to generate manual labels using sct_label_utils -create-viewer.

Hope that helps!

1 Like

Hi @jcohenadad - thank you for the informative reply!

I just shared the cervical dataset that exhibited the S-I overwarping.

It sounds like, going forward, identifying two points for either the cervical or thoracic datasets is the most robust approach. Your comment about choosing the two points that encompass the region that you care about the most was also very helpful… especially in the context of the thoracolumbar imaging. For example, for a given subject, the spinal cord might end just above label 20 but label 21 is visible in the image, and so I was selecting 21 as the caudal label because it was still in the field of view. This always troubled me somewhat because I could see that sct_deepseg_sc wasn’t defining the spinal cord past label 20 and yet I was defining label 21 in sct_label_utils. I will go back through the thoracolumbar datasets and re-select the most appropriate rostral and caudal labels…


1 Like

Hi Rob,

I’ve applied straightening on the data you shared, but I do not observe abnormal S-I deformation. See below, measurement over a few levels in straight vs. curved spaced (in a location where the cord is naturally “almost” straight to be able to compare distance measurements)-- they match well:

So the problem is not the straightening.

However, the vertebral labeling does produce funky results:

Screen Shot 2021-03-07 at 4.46.56 PM

Relying on these wrong vertebral labeling to register to the PAM50 template, this will definitely result in spurious S-I stretching. Which is why QCing the output vertebral labeling is important, to be able to manually correct mis-labeling. If you’re OK doing the manual vertebral labeling for all labels, then you can simply bypass sct_label_vertebrae and provide two disc labels per subject as discussed in this thread. This seems the best approach in your case.

P.S. I am not a huge fan of this line:

mv t2r_seg.nii t2_seg.nii

Given that you also have a file called t2.nii, this is asking for trouble in the future :sweat_smile:.



Thank you, Julien! This discussion has been helpful, and I hope will be a go-to resource for many SCT users in the future.

I modified the cervical pipeline by using sct_label_utils -create-viewer 3,8, removing sct_label_vertebrae, and using sct_register_to_template -ldisc instead of sct_register_to_template -l. The results look good across datasets.



PS: Regarding the above line of code… I sometimes live life on the wild side by leaving such lines here and there so that a year from now I can look at these scripts again and wonder, “What the heck was this code supposed to do?” :wink:

1 Like