Message Boards Message Boards

Poisson disk sampling

Posted 7 months ago

 Poisson disk sampling -- various geometric regions

Attachments:
POSTED BY: Denis Ivanov
7 Replies
Posted 7 months ago

Take a look at the [Experimental] function HardcorePointProcess.

proc = HardcorePointProcess[30, 0.3, 2];
reg = Rectangle[{0, 0}, {10, 10}];
pts = RandomPointConfiguration[proc, reg];
Show[VoronoiMesh[pts[[1, 1]]], PlotRange -> {{0, 10}, {0, 10}}]

Voronoi mesh

POSTED BY: Jim Baldwin
Posted 7 months ago

Thank you, but I’m glad I handled the details of the algorithm myself.
In addition, the parameter randomness will be useful for further research.
But I did not pay attention to Spatial Point Processes, they are also very useful, so thank you again!

POSTED BY: Denis Ivanov

enter image description here -- you have earned Featured Contributor Badge enter image description here Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: EDITORIAL BOARD
Posted 7 months ago

The polycrystalline mesh regions at the end of this post are really appealing to me. So I applied my MeshVoronoiEntropy function which got recently published in Wolfram Function Repository https://resources.wolframcloud.com/FunctionRepository/resources/MeshVoronoiEntropy/

First, let's extract the bare mesh regions in order to apply MeshVoronoiEntropy function

meshstructs = MapThread[
   VoronoiMesh[First /@ #1, {{0., 1.}, {0., 1.}},
     MeshCellStyle -> {{2, All} -> LightYellow, {1, All} -> Brown},
     ImageSize -> 150] &,
   {data3, paramList}]; 

and I got the values for the corresponding Voronoi entropy, which is actually a form of Shannon entropy applied to polygon meshes as documented in Wolfram Function Repository.

This gives the Voronoi entropy for each mesh region.

meshVorEntr=ResourceFunction["MeshVoronoiEntropy"]/@meshstructs
{0.622363,0.575437,0.813453,1.09041,1.17685,1.28494}

The entropy is lowest for polycrystalline regions, as shown in the remastered grid picture

Grid[Partition[
MapThread[
Labeled[VoronoiMesh[First /@ #1, {{0., 1.}, {0., 1.}},
MeshCellStyle -> {{2, All} -> LightYellow, {1, All} -> Brown},
ImageSize -> 150], "Voronoi Entropy  " <> ToString@#2] &,
{data3, meshVorEntr}],
3]] 

Voronoi Entropy for different configurations

POSTED BY: Jessica Alfonsi
Posted 7 months ago

Dear Jessica,
This parameter (and your function) will be very useful to me in the study that will be published soon.
It’s about the distribution of the pores of the mushrooms (Tinder Fungi).
Here’s a fragment of it's Voronoi Mesh :
enter image description here

I think it’s like Poisson Disk with Voronoi Entropy $1.0 \le VE \le 1.2$, but not sure exactly.
I’m comparing distributions by different parameters, and definitely add yours.
There should be a post in these groups within a week, and I’ll be glad if you to take a look (-_-)

POSTED BY: Denis Ivanov
Posted 7 months ago

I'm very glad that you found my contribution helpful for your research work. I will certainly have a look at this post in the forthcoming days and I would be really interested to have a look at your paper before submission.

POSTED BY: Jessica Alfonsi
Posted 6 months ago

Dear Denis, I think I have an answer for your picture. I just applied these lines of code to the picture you posted for the fungi pores. First, I imported your image as imfungi. Then apply ImageMesh

regBinIm = ImageMesh[imfungi]

Now, count the number of 2D mesh cells for each kind of polygon having from 3 up to 13 sides, according to the definition of Voronoi entropy

numedgepoly = 
 Table[Length@
   Cases[MeshCells[regBinIm, 2], 
    Polygon[Flatten@Table[{_}, {i}]]], {i, 3, 13}]

You can also get the total number of polygons in your picture by applying Total to the previously obtained list. You can also check that it's equal to the number of ConnectedMeshComponents obtained from ImageMesh region. I get a total number of 913 polygons. These are the final data to compute Voronoi entropy

 kdata=numedgepoly/Total[numedgepoly]
{0,207/913,410/913,245/913,47/913,4/913,0,0,0,0,0}

Then delete elements equal to zero (i.e. polygons with higher number of edges or 3 edges) in order to suppress indeterminate error message from Log function with

DeleteCases[kdata,0]
{207/913,410/913,245/913,47/913,4/913}

and finally you can compute the Voronoi entropy, actually the form of Shannon entropy with

-Total@Map[#*Log[#]&,DeleteCases[kdata,0]]//N

which gives the result 1.22549, a little above the number you inferred from simulations. This can also be refined by a better image manipulation at the start. I hope this can be a helpful strategy for other pictures!

POSTED BY: Jessica Alfonsi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract