To make sure that your calculations are right, you can visualize the centerline using the CPR mapper by adding this code in Sources\Rendering\OpenGL\ImageCPRMapper\index.js at line 806:
tcoordFSImpl.push(
'if (abs(horizontalOffset) < 1.0)',
'{',
' gl_FragData[0] = vec4(1.0, 0.0, 0.0, 1.0);',
' return;',
'}'
);