Skip to main content

calcMeanShapeDeviations.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function calculates the mean 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 mean shape deviation


function meanShapeDeviations = calcMeanShapeDeviations(optimizedCurves)

optimizedCurvesShapes = optimizedCurves - mean(mean(optimizedCurves, 1), 3);
meanShapeDeviations = optimizedCurvesShapes - mean(optimizedCurvesShapes, 2);
end