

colormap(jet)

[img, proj_orig, eig, locs] = showShapeSpace(model, randperm(size(model.cellShapeModel.positions,1)), true, model.cellShapeModel.positions);



locs = locs((~all(isnan(locs),2)),:);

tes = delaunayn(locs);

figure('color', 'k'), imshow(img);
saveas(gcf, 'shapespace.png', 'png')

figure('color', 'k'), imshow(img);
hold on
triplot(tes,locs(:,1)+40, locs(:,2)-50);
saveas(gcf, 'shapespace_tri.png', 'png')

