Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve sct_label_vertebrae by skipping straightening (using orthogonal planes) #3395

Closed
jcohenadad opened this issue May 18, 2021 · 5 comments · Fixed by #4080
Closed

Improve sct_label_vertebrae by skipping straightening (using orthogonal planes) #3395

jcohenadad opened this issue May 18, 2021 · 5 comments · Fixed by #4080
Assignees
Labels
Milestone

Comments

@jcohenadad
Copy link
Member

jcohenadad commented May 18, 2021

Context

Currently, in sct_label_vertebrae there is a necessary step which involves straightening the spinal cord (ie: bringing it from the natural curved space to a "straight" spinal cord). This step is required by:

  • the current template-based disc detection and;
  • the option sct_label_vertebrae -discfile, which uses a disc label and produces a labeled segmentation.

The problem is that the straightening is very long, and is also prone to errors and inaccuracies (notably related to a parameter defining the smoothness of the centerline).

Suggestion

Implement a function that computes the plane orthogonal to the spinal cord centerline and that passes through a label. That way, straightening can be avoided.

image

Note that this approach will also become useful once the new deep learning-based disc detection method is available in SCT.

@joshuacwnewton joshuacwnewton closed this as not planned Won't fix, can't repro, duplicate, stale Jan 13, 2023
@joshuacwnewton joshuacwnewton changed the title Bypass spinal cord straightening by computing plane orthogonal to spinal cord centerline Improve sct_label_vertebrae by skipping straightening (by computing plane orthogonal to spinal cord centerline) Jan 18, 2023
@joshuacwnewton joshuacwnewton changed the title Improve sct_label_vertebrae by skipping straightening (by computing plane orthogonal to spinal cord centerline) Improve sct_label_vertebrae by skipping straightening (using orthogonal planes) Jan 29, 2023
@jcohenadad jcohenadad assigned valosekj and unassigned NadiaBlostein Mar 21, 2023
@jcohenadad
Copy link
Member Author

@NadiaBlostein Could you please point us to your Venus-SCT code that does compute the plane orthogonal to the spinal cord centerline? This will be useful for @valosekj who will work on this issue.

An alternative approach, instead of computing the orthogonal plane to the centerline, would be to compute the shortest distance between each disc label and a point on the centerline. Maybe this could be implemented by iterating across all points on the centerline, computing the distance, and keeping the shortest distance as the candidate. @sandrinebedard @benjamindeleener do you have any other suggestions?

@NadiaBlostein
Copy link
Member

Here it is!

@valosekj
Copy link
Member

I discovered that the functionality performing labeling from discs (without applying the straightening) is available within the labels.labelize_from_discs function.

It can be run by:

sct_label_utils.py -i sub-001_seg.nii.gz -disc labels.nii.gz -o sub-001_seg_labeled.nii.gz

However, the current implementation does not deal with the level above the top disc and the level below the bottom disc. In other words, the levels above and below the first and the last discs are not labelled:

image

I proposed a solution in #4072

@valosekj
Copy link
Member

valosekj commented Mar 21, 2023

It is important to note that the solution proposed in #4072 does not compute orthogonal projection or shortest distance. It just takes the slice corresponding to the disc. This seems fine for 1) images with thick slices (like axially acquired images with ~3 mm slice thickness) as shown here and 2) images with mild spinal cord curvature.

However, @NathanMolinier pointed out a relevant comment that for images with thin slices (like 1mm slice thickness), the discrepancy might occur:

image

@NathanMolinier
Copy link
Contributor

Just to add a quick comment about the difference between the two following methods:

  • doing an orthogonal projection
  • finding the closest point

In a continuous world, doing an orthogonal projection of a point or finding the closest point on a line should converge to the same point however this is not our case, because images are made of discrete pixels.

Therefore:

Doing an orthogonal projection will lead to the real closest coordinate which will be a float coordinate, whereas finding the closest point on a discrete line will lead to an integer coordinate.

Our choice will depend on how precise we want our method to be. This point is also relevant if we want to compare the performances of several methods (like here)

Note: Our precision also depends on how precisely are gathered ground truth labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants