Detailed description 

When calculating a pill mesh, it is possible for the calculation of the bounding box of a cell to go slightly below 1 or slightly above the size of the image matrix. This leads to an index error when extracting that bounding box from the larger image.
We fixed the error by changing the code in get_pillmesh_profile.m as follows:
%get bounding box of polygon
s = size(im_mat)
x_l=max(floor(min(X)), 1);
x_r=min(ceil(max(X)), s(2));
y_d=max(floor(min(Y)), 1);
y_u=min(ceil(max(Y)), s(1));
Let me know if there's a repository I can submit a pull request against and I would be happy to do so.
 Adam Strandberg
Fellow, Garner Lab 
