title: Connecting discontinuous lines spinal roots
body: <p>I have a project to build a 3D model of the spinal roots in order to simulate the stimulation by an electrode. For the moment I've been handled two things, the extracted positions of the spinal roots (from the CT scans) and the selected segments out of the points (see both pictures down below). The data I'm provided is in 3D and all the segments are clearly distinct although it does not look like it on the figures below as it is zoomed out.</p>
  <p>Points and segments extracted from the spinal cord CT scans:
  <a href="https://i.stack.imgur.com/2yDh5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2yDh5.jpg" alt="Points and segments extracted from the spinal cord CT scans" /></a>.</p>
  <p>Selected segments out of the points:
  <a href="https://i.stack.imgur.com/BggW3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BggW3.jpg" alt="Selected segments out of the points" /></a></p>
  <p>I'm now trying to connect these segments so as to have the centrelines for all the spinal roots at the end. The segments are not classified, simply of different colors to differentiate them on the plot. The task is then about vertically connecting the segments that look to be part of the same root path.
  I've been reviewing the literature on how I could tackle that issue. As I'm still quite new to the field I don't have much intuition on what could work and what could not. I have two subtasks to solve here, connecting the lines and classifying the roots, and while connecting the segments after classification seems no big deal, classifying them seems decently harder. So I'm not sure in which order to proceed.
  Here are the few options I'm considering to deal with the task :</p>
  <ul>
  <li>Use a Kalman filter to extract the vertical lines from the selected segments and the missing parts</li>
  <li>Use of a Hough transform to detect vertical lines, by trying to express the spinal root segments in the parametric space and see how they cluster and see if anything can be inferred from there.</li>
  <li>Apply some sort of SVM classification algorithm on the segments to classify them by roots. I could characterize each segment by its orientation and position, and classify them based on similarities in the parameters I'm selecting, and then connect the segments. Or use the endpoint position of each segment and connect it to one of the nearest neighbours if their orientation/position is matching.</li>
  </ul>
  <p>I'm open to any suggestions, any piece of advice, or any other ideas on how to deal with the current problem.</p>