# Reconstructing Nerve Structures from Unorganized Points
## 1 Introduction  
There are a number of tasks we humans tend to solve effortlessly and almost intuitively, which machines find complicated and often require intricate algorithms for solving them. One such task is connecting seemingly randomized points into a meaningful shape. This type of 2D reconstruction is fundamental across a myriad of application areas: digital image processing, computer vision, reverse engineering, material quality control, 3D medical image reconstruction, and handwriting recognition, among others. In our case, the need for the development of such a technique for line reconstruction emerged during the in silico modeling of a human peripheral nerve. A 2017 study showed that approximately 57.7-million people worldwide were living with limb amputation caused by a traumatic injury [1]. This study did not account for other common causes of extremity loss, such as diabetic neuropathy, cancer, infection, or burn injuries. Recent advances in the field of neurotechnology have enabled scientists to develop new methods that could help amputees [2]. Today, there are numerous prostheses available for both upper and lower limbs. However, there is significant room for improvement in restoring sensory feedback to amputees. Nerve fibers are responsible for transmitting information between the Central Nervous System (CNS) and the peripheral effectors, and vice versa. These fibers bundle together to form nerve fascicles, which are essentially groups or bundles of nerve fibers within anerve. Fascicles often exhibit intricate patterns of crossings and branchings. Recent studies have highlighted that direct electrostimulation of the remaining portions of a peripheral nerve can successfully generate physiologically relevant sensations, such as touch, pressure, vibration, and tingling [3; 4; 5; 6; 7]. Owing to the significant variability in peripheral nerve anatomy and its unique characteristics, it is unfeasible to standardize electrode positioning and stimulation protocols. Instead of resorting to clinical animal or human trials, which are generally complicated, risky, and bring a high cost, in silico modeling offers a promising alternative [3; 8; 9; 10]. The combination of the Finite Element Method (FEM) with Neuron Modeling (hybrid electro-neural modeling) could simulate the effects of the electrical stimulation of residual peripheral nerves, i.e., the nerve fibers (axons) contained within, thus facilitating electrode positioning and stimulation paradigm optimization. Detailed and realistic nerve structure modeling would undoubtedly enhance the precision of these models. An in silico method for nerve contour reconstruction would certainly be an integral step. We introduced a technique specifically designed for this purpose, but one that could, with some minor adjustments, also find its use in a handful of other disciplines. The persistent challenge of curve (re)construction from an unorganized set of points, coupled with the need for a reliable solution, has motivated numerous scientists to address this issue. However, this is not an easy task. Its complexity largely depends on the assignment, particularly the characteristics of the point set and the desired curve shape. A nonuniform point distribution, the high proximity of contours, as well as sharp corners they could contain are just some of the most-common problems such algorithms can encounter. However, few have successfully tackled these challenges. Existing techniques vary in their performance and in how they formulate and approach these tasks. More about line types each of them is able to reconstruct, their similarities, and their differences will be discussed in Section 2. Section 3 presents the motivation for this study and gives a detailed insight into the problem that needed to be addressed during realistic nerve contour reconstruction. Section 4 describes the innovative way in which the authors approached the problem, which combines techniques such as valley-seeking clustering, the adaptive Kalman filter, and Nearest Neighbor (NN) classification.