So, I have been continuing to work on the salvage algorithm for the iliac tracking. There is a particularly perplexing situation where one iliac tracks properly and the other fails. The question arises as to how exactly to identify a better starting point for the failed iliac artery. Basically, all I have to work with is a list of point which are highly likely to be either in the aorta or common iliac arteries. The algorithm prior to this stage has done a lot of statistical sorting of the points to whittle them down to the highest yield points. At any rate, for the salvage algorithm, I realized that all of the previous analysis was not necessarily applicable in this case because you essentially can take very little for granted. I messed around with a bunch of very complicated and convoluted logic steps to try to isolate a good alternate starting point.
It turns out that after all that work, I was still getting very unreliable results. The fundamental issue being that I don't have the ability to write a hunk of code that, from a logic standpoint, can account for the myriad of possible configuration that arise in nature. As I thought about the problem on a more abstract level, I started to conceptualize the problem as one of bipolar attraction and repulsion. if a potential point is very close to the string of point that represent the successful iliac artery, then that point is very unlikely to represent a good starting point. This of course is exactly the calculation for the potential relative to a line of charge. So, I did exactly that... I treated each point of the opposite iliac artery as a point charge and calculated the field for each of the potential points. The assumption being that the point furthest from the line of charge will have the lowest potential and also have the highest change of being a successful starting point.
It took a couple of days of debugging to get the algorithm to do what it is supposed to do, but at the end of the day, I finally got it to give a correct result on the test case. Unfortunately, for these special cases, there are only a handful of studies that end up using this portion of the algorithm which makes robustness testing very difficult. At the very least I will be able to try it out on the 4 or so other case I have that run into similar issues.