Skip to main content

calcShapeDeviations.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function calculates the shape difference between two curves. The
% purpose of this is to be used in a cost function that incentivises the
% optimized curve to closely match the original curve.
%
% (3D array of number, 3D array of number) -> (2D array of number)
% Calculates shape deviation


function shapeDeviations = calcShapeDeviations(optimizedCurves, ...
originalCurves)

optimizedCurvesShapes = optimizedCurves - mean(mean(optimizedCurves, 1), 3);
originalCurvesShapes = originalCurves - mean(mean(originalCurves, 1), 3);
shapeDeviations = optimizedCurvesShapes - originalCurvesShapes;
end