Error in constrained delaunay triangulation

12 views (last 30 days)
Rebecca Jones
Rebecca Jones on 14 Nov 2019
Answered: Steven Lord on 14 Nov 2019
Hello!
I'm writing a script that will let me determine the delaunay triangulation of particles within a cell. I would like to use a constrained delaunay so that the nucleus and the cell perimeter is not crossed by the triangulation. I am using draw freehand to outline the cell and the nucleus but when I then try and get the triangulation, I get the following error:
>> LysosomeDistribution
Error using delaunayTriangulation/subsasgn The input must contain index values;
entries with fractional parts are invalid.
Error in LysosomeDistribution (line 64)
DT.Constraints=CellPerimeter;
I can get around this by using CellPerimeter=round(CellPerimeter) earlier in the script though this isn't ideal and I subsequently get the following error:
Error using delaunayTriangulation/subsasgn The input must contain index values in the range 1 to num-points.
Error in LysosomeDistribution (line 64)
DT.Constraints=CellPerimeter;
Is there a way that I can constrain the DT with the nucleus and cell perimeters whilst maintaining their values?
I have attached the script I am using, and an example cell image and the matching XY coordinates for the particles in the cell (which were an output from imageJ.

Answers (1)

Steven Lord
Steven Lord on 14 Nov 2019
In a delaunayTriangulation, the constraint input C does not contain the coordinates of points that define a constrained edge but the indices of those points in the P or x and y inputs. I'm not certain how easy it would be to convert the output of drawfreehand to the indices. ismembertol may be of help to you in doing that, finding which of your original data points are "close enough" to the coordinates you get from drawfreehand.

Categories

Find more on Delaunay Triangulation in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!