{'fraction_non_alphanumeric': 0.030011516834902784, 'fraction_numerical': 0.010839374026149989, 'mean_word_length': 4.547538519353626, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Model-based Catheter Segmentation in MRI-images

Accurate and reliable segmentation of catheters in MR-gui- ded interventions remains a challenge, and a step of critical importance in clinical workflows. In this work, under reasonable assumptions, me- chanical model based heuristics guide the segmentation process allows correct catheter identification rates greater than 98% (error 2.88 mm), and reduction in outliers to one-fourth compared to the state of the art. Given distal tips, searching towards the proximal ends of the catheters is guided by mechanical models that are estimated on a per-catheter basis. Their bending characteristics are used to constrain the image fea- ture based candidate points. The final catheter trajectories are hybrid sequences of individual points, each derived from model and image fea- tures. We evaluate the method on a database of 10 patient MRI scans including 101 manually segmented catheters. The mean errors were 1.40 mm and the median errors were 1.05 mm. The number of outliers devi- ating more than 2 mm from the gold standard is 7, and the number of outliers deviating more than 3 mm from the gold standard is just 2.


Introduction
MRI imaging is a standard component in the tools for diagnosis, biopsy, and treatment of numerous types of cancers [5] due to the superior soft tissue contrast it provides. While MRI scans provide the physician with improved imaging of the tumor and adjacent soft tissue (compared to x-ray, ultrasound, or CT), the artifacts created in these scans by typical catheters are much more difficult to interpret. For instance, artifacts created by catheters with metalic stylets in x-ray or CT scans acquired during pelvic brachytherapy are very distinct and amenable to automatic segmentation using standard image-processing techniques in commercial products such as Oncentra Brachytherapy 4 and Eclipse 5 . Today, no corresponding specialized automatic solutions exist for MRI [8,1].
We believe that in the absence of reliable automatic segmentation tools for this task, MRI-guided catheter-based interventions will not gain mainstream acceptance; manual accomplishment of this task is time consuming, tedious, and error-prone, and requires significant concentration of the operator. We propose a new highly accurate catheter segmentation method based on a search cone [7] and use a benchmark database with a significant number of catheters using different MRI imaging protocols for validation.

Related Work
The appearance of catheters in MRI images is influenced by the imaging parameters, susceptibility effects, and the direction of the static magnetic field relative to that of the catheter [8,1]. Another challenge is posed by varying, deflected catheters caused by different forces interacting with them during insertion into the body. Vesselness measures [2] try to enhance tubular structures such as vessels in the images, but suffer heavily from oversegmentation. In [6] a catheter segmentation method for 2D B-mode ultrasound images using Hough transforms is proposed. For 3D MRI images in [7], a sequence of Fibonacci-sized conical search regions is used. In [3] three catheter models are compared in terms of deflection accuracy measured against a physical experiment.
Here, we based our model based segmentation method on two assumptions: (1) catheters for biopsy and treatment are typically introduced from a firm base (known as template, fixture, or guide); (2) the overall catheter deflection can be approximately modelled by a main force acting on the catheter tip.

Methods
Angular Spring Models In [3] the most effective model for the simulation of catheter bending was reported to be the angular spring model. In this approach the catheter is regarded as an array of a finite number of stiff line segments (cantilever rods) connected by angular springs. Following these ideas and simplifying the approach by neglecting model convergence over time for efficiency reasons, we can use the following forward and backward schemes to calculate segment-wise deflection angles α i , the total deflection angle α sum i and segment orthogonal end point forces F i in 2D. The calculation works either in a forward manner starting from the fixed end (the proximal end of the catheter in our case) or in a backward fashion starting from a given catheter tip for a number of segments N seg (i = 0..N seg − 1): where k a is the physical angular spring stiffness [N/m] of the catheter and F giv 0 is the effective main force acting on the catheter at the tip. The angle α sum i describes the total segment angle compared to a non-bent catheter (reference catheter) in the forward and backward simulation. It is easy to see that in the backward simulation starting from the given catheter tip, we need estimates for α sum 0 and orthogonal segment force F est 0 . Model Estimation The first step in our new algorithm is the estimation of the angular spring model. For this aim, it is necessary to have a reference catheter direction r representing a non-deflected catheter. For many catheter grid based procedures, the reference direction can be inferred using the base (or template) that defines a normal plane P which is assumed orthogonal to a straight catheter 6 . Given the reference catheter vector r⊥P with a declination α ref from the SI-axis (z) the segment sum angle α sum 0 for the backward simulation can be estimated from a large catheter segment vector l l found by distal-proximal ray casting favoring dark lines (see step 1 below for details): Furthermore, an estimate of the catheter length a disregarding bending using distance from the base template plane P is needed, where d P calculates point distance from a plane. 6 The estimation of the normal plane for specific clinical applications can be a topic of investigation on its own. In the case of pelvic brachytherapy with a template grid, four vitamin E capsules implanted in the template create hyperintense artificats in the MR and specify a regression plane for the reference catheter direction.
For the remaining estimation of F 0 the deflection from the tip to the reference catheter r in normal direction is estimated. With these parameter estimates, we can compute the remaining model parameter F est 0 for backward tracking of the catheter model, i.e. a look up in a finely interpolated model table parametrized by a and d yields F est 0 . Note, every position between the undeflected and the most deflected catheter has a force value F intp assigned that can be used as F est 0 . The refined model lookup table calculates Fig. 1 nearly without gaps (100 sample points in each direction). Linear interpolation is used for positions still inbetween supporting (a, d)-points.
Model Guided Catheter Search Details:

Model Initializing First Cone Search
In this phase starting from the tip t 0 the search cone [7] covers half of the estimated catheter length a and searches a first point on the catheter approximately in the middle. A step direction vector a 2 · r helps in the initialization phase. The step is robust and in most cases finds the middle of the catheter as most catheters are rather straight from the tip up to their middle (cf. Fig. 1). The found long segment l l is the basis for the model estimation phase described above. Now, the main catheter detection processing starts again from the tip t 0 , uses the initialized model as a guide, and works its way using N c − 1 shorter segments towards the proximal end.
First Catheter Point Detection Iteration (k = 0) While the top of the cone t 0 is the given tip position, the base point of the first cone search is derived as b 0 = t 0 + a Nc−1 · l l and the located point is accepted as t 1 . After this step, the first short segment l s is estimated and allows the definition of the first local segment coordinate system to which the angular spring model can relate. 2. Definition of Local Segment Coordinate Systems (k = 1..N c − 1) With an accepted catheter segment l s found by ray casting, for each segment a local right-handed coordinate system is set-up coherent to the LPI image directions. They consist of the catheter deflection plane normal n loc defining the 2D (a, d)plane for the catheter bending simulation (cf. Fig. 1), deflection direction d loc (cf. d) and reference direction r loc (cf. a). For every iteration, they are newly defined using the last accepted segment vector l s =t k − t k−1 (t k is the top of the current cone, cf. Fig. 2) n loc = l s l s × r loc r loc ; d loc = n loc n loc × r loc r loc ; r loc = n loc n loc × d loc d loc .
This allows the model catheter to deflect in more than one plane and makes the algorithm truly 3D capable. From step to step, the local coordinate systems slightly rotate. For increased efficiency, we also do not need to use more than one spring for the rod joints as proposed in [3].

Model-based Cone Search
The top point of the cone t k is a definitely accepted catheter point and the base point defining the center of a circular region as cone base is proposed as follows (cf. Fig. 2): Metrically synchronously to the cone search and subject to the local coordinate system, deflection backward simulation steps take place. Finally, a new model cone base point b mod is proposed adding a model-based step vector to the current cone top t k resulting in Here, d seg = a/ (N c − 1) represents the chosen segment length. If the point c img found by ray casting inside the search cone at the base fulfills the distance constraint it is accepted valid as next cone top t k+1 and added to the list of catheter defining points (see Fig. 2).
Model Constraint Violation Otherwise, if the point c img found from image features deviates too far from the model proposed base point b mod an acceptable compromise point c acc is generated and inserted into the list of found catheter points: By this means, the resulting catheter trajectory is a compromise or hybrid between image feature based and model based point proposals.
Image Features Preferred and Final Catheter Definition Catheter trajectories appear as signal voids in MR scans, while the surrounding tissue is brighter. Thus, we use a small circular gradient inspired 2D mask that responds to this pattern and also consider the expected geometry of the catheter crosssections (diameter). When searching in conic regions by ray casting, we look for distal to proximal line integrals minimizing the image intensity value taking the preferred gradient pattern into account by subtracting it from the sum. Finally, the hybrid model and image feature based points are approximated by a Bezier curve [7] with N c control points.
The plastic catheters (diameter 1.6 mm or 16 Gauge) have a metallic needle inlay made of tungsten-alloy and an average insertion depth of 74 mm. We use 7 search cones with equal height d seg = a/ (N c − 1), N c =8. Our synchronous catheter model simulation always uses N seg = 20 segments for full length (187 mm). We empirically choose k a = 2050 µNm as our 16 Gauge catheters are stiffer than those (18 Gauge) presented in [3]. The radius of the cone base circle R con is set generously to 20 mm to evaluate the model vs. the image features influence.
Three experiments are conducted in this work by varying the tolerance d tol as 0/∞/1 mm: (1) "full model" using guidance model points only, (2) "image features only" with fully image feature based points and (3) "trade-off" as a compromise or hybrid mode between model and image features based points as core contribution of this paper.

Results
The Hausdorff distance (HD) between the gold standard and automatic segmentations in the patient MR images was evaluated. The HD quantifies the maximal distance between two catheter tubes [4] and thus is a very strict measure which is necessary for evaluation of clinical applicability.
Qualitative results for two different examples can be seen in Fig. 3 and demo movies 7 . The top rows illustrates cross-sectional and 3D rendered views of automated segmentations of a catheter array. The overlap of the colored catheters shows how well they agree. The bottom row of this figure illustrates the case of one particular catheter from the experiments, and specifically how both the model and image guidance are necessary to achieve correct segmentation.
Quantitatively, as can be seen in Fig. 4, comparing experiment (2) and (3) the number of critical outliers (HD>3 mm) can be significantly reduced to one sixth. Outliers with >2 mm HD can be reduced from 15 to 7 (53%). For (3), the threshold for the number of outliers to increase from 2 to 3 is 2.88 mm. Regarding (3), the median value that represents the most frequent result in a clinical setting is not significantly higher than for using image features alone (2). Apart from that, using the estimated model alone is not advisable, as the mean/median values as well as the indicators of robustness (standard deviation, quartile ranges) are too high. This is reflected in the statistics: The differences between the results of the experiments are statistically different (Kruskal-Wallis ANOVA on ranks test: p < 0.001). Tukey post-hoc tests show differences between   For experiment (2) one outlier at 18 mm is not shown in the graphics for display reasons; or overlap or are located in the maximum range (whisker). experiment (1) vs. (2) and (3) to be significant (p < 0.05), while (2) and (3) do not differ. The segmentation time for a single catheter is 2 seconds on an standard Intel i7 3 GHz computer (Python implementation in Slicer 8 ).

Conclusion
The incorporation of our proposed model strongly helps to shift the state of the art in catheter segmentation from MRI [7] towards practical clinically usability by reducing outliers to one-fourth (there 8 needles with HD>4 mm).
The proposed model guided catheter segmentation approach (exp. (3)) can reduce the number of outliers with HD>3 mm to one sixth, compared to using image features alone (exp. (2)). The number of outliers with HD>2 mm can be reduced by half between these two experiments. The benefit of the model is to filter out implausible outliers from the image-based feature points which would cause improbable curvatures in the segmented catheter trajectory. This is an important contribution towards enabling practical clinical acceptance of MRI-guided interventions, a trend that is gaining momentum in recent years.

Discussion and Future Work
We have shown that a hybrid strategy is necessary for catheter segmentation from MRI because alone, neither image feature nor model based catheter point estimations, delivers consistently correct results. The initialization of the model is an area that needs further investigation, especially regarding more bent catheters.