The2DShapeStructureDataset.jl

The2DShapeStructureDatasetModule

The2DShapeStructureDataset.jl

Static Badge

This is a convenience package for working with The 2D Shape Structure Dataset. The dataset has the following copyright notice

Copyright (c) [2016] [A. Carlier, K. Leonard, S. Hahmann, G. Morin, M. Collins]

and is licensed under an MIT-License.

The whole dataset is 1.8 MB large (zipped) and is only downloaded once when you use this package.

Quickstart

Install this package from the General Registry:

julia> ]
pkg> add The2DShapeStructureDataset

and make it available:

julia> using The2DShapeStructureDataset

You can then obtain the coordinates for, say, the structure apple-1:

julia> shape_coords("apple-1")
2×112 Matrix{Float64}:
 0.0      0.0      0.0047847  …  0.0      0.0      0.0
 0.41627  0.44498  0.47368       0.38278  0.41148  0.41627

Find out what shapes are available by calling shape_names or visiting the visual explorer.

source

Docstrings

The2DShapeStructureDataset.shape_coordsMethod
shape_coords(name)

Returns a 2 ⨯ n Matrix with all coordinates of the shape with the given name. Use shape_names to find all possible inputs for this function.

julia> shape_coords("Bone-1")
2×106 Matrix{Float64}:
 0.34174  0.3578   0.37615  …  0.32339  0.33945  0.34174
 0.5      0.52523  0.55046     0.46789  0.49312  0.5
source
The2DShapeStructureDataset.shape_ringFunction
shape_ring(name)
Info

Requires the Meshes.jl package being loaded.

Returns the same coordinates as shape_coords but as a Ring from Meshes.jl.

julia> shape_ring("Bone-1")
Ring
├─ Point(x: 0.34174 m, y: 0.5 m)
├─ Point(x: 0.3578 m, y: 0.52523 m)
├─ Point(x: 0.37615 m, y: 0.55046 m)
├─ Point(x: 0.3922 m, y: 0.57569 m)
├─ Point(x: 0.40826 m, y: 0.60092 m)
⋮
├─ Point(x: 0.28899 m, y: 0.41743 m)
├─ Point(x: 0.30505 m, y: 0.44266 m)
├─ Point(x: 0.32339 m, y: 0.46789 m)
├─ Point(x: 0.33945 m, y: 0.49312 m)
└─ Point(x: 0.34174 m, y: 0.5 m)
source
The2DShapeStructureDataset.shape_sample_outlineFunction
shape_sample_outline(name, n)
Info

Requires the Meshes.jl package being loaded.

Returns a 2 ⨯ n Matrix of n points homogeneously sampled from the outline of the shape with the given name.

julia> shape_sample_outline("Bone-1", 10)
2×10 Matrix{Float64}:
 0.213944   0.0874572  0.695606  …  0.778814  0.681997
 0.0313239  0.0992228  0.753576     0.906329  0.955572
source
The2DShapeStructureDataset.shape_sample_innerFunction
shape_sample_inner(name, n)
Info

Requires the Meshes.jl package being loaded.

Returns a 2 ⨯ n Matrix of n points homogeneously sampled from the interior of the shape with the given name.

julia> shape_sample_inner("Bone-1", 10)
2×10 Matrix{Float64}:
 0.0754321  0.727358  0.19444   …  0.645929  0.323449  0.638125
 0.241538   0.747493  0.188188     0.778322  0.370565  0.79197
source