+ // Find right limit of Esophagus and Aorta
+ clitk::FindExtremaPointInAGivenDirection<MaskSliceType>(eso_slices[i], GetBackgroundValue(), 0, true, sp_maxRight_Eso);
+ bool f = clitk::FindExtremaPointInAGivenDirection<MaskSliceType>(aorta_slices[i], GetBackgroundValue(), 0, true, sp_maxRight_Aorta);
+ clitk::PointsUtils<MaskImageType>::Convert2DTo3D(sp_maxRight_Eso, EsophagusForSlice, i, p);
+ clitk::PointsUtils<MaskImageType>::Convert2DTo3D(sp_maxRight_Aorta, Aorta, i, pp);
+ pp[0] -= 2; // Add a margin of 2 mm to include the Aorta 'wall'
+ p_AllPoints.push_back(p);
+ if (f) {
+ p_AllPoints.push_back(pp);
+ MaskImagePointType A = p_RightMostPost.back();
+ MaskImagePointType B = p;
+ MaskImagePointType C = pp;
+ double s = (B[0] - A[0]) * (C[1] - A[1]) - (B[1] - A[1]) * (C[0] - A[0]);
+ if (s>0) p_RightMostAnt.push_back(p);
+ else p_RightMostAnt.push_back(pp);
+ }
+ else {
+ p_RightMostAnt.push_back(p);
+ }
+