Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 19:30
    schillic review_requested #2847
  • 19:30
    schillic synchronize #2849
  • 19:30

    schillic on 2831

    review witness production for interval… (compare)

  • 18:33
    schillic edited #2847
  • 18:27
    schillic synchronize #2847
  • 18:27

    schillic on 2845

    review (compare)

  • 18:22
    mforets opened #2852
  • 16:37

    schillic on gh-pages

    build based on fb903ff (compare)

  • 16:23
    schillic updated the wiki
  • 16:22

    schillic on underapprox

    (compare)

  • 16:22

    schillic on master

    cleanup underapproximate Merge branch 'master' into mfor… remove unfinished sentence and 2 more (compare)

  • 16:22
    schillic closed #2306
  • 15:02
    mforets commented #2306
  • 15:00
    mforets synchronize #2306
  • 15:00

    mforets on underapprox

    add inplace version (compare)

  • 14:58

    mforets on makie

    updates in plot3d (compare)

  • 14:44
    mforets edited #2851
  • 14:44
    mforets opened #2851
  • 14:37
    mforets labeled #2850
  • 14:37
    mforets opened #2850
Marcelo Forets
@mforets
we could migrate to github CI as with some of the other projects
or try travis ci .com
if i got o
Since June 15th, 2021, the building on travis-ci.org is ceased. Please use travis-ci.com from now on
Christian Schilling
@schillic
indeed
Marcelo Forets
@mforets
nice post by Luca
Christian Schilling
@schillic
:+1:
Dale-Black
@Dale-Black

Is LazySets.jl the right place to go for initializing level sets, like https://github.com/pmneila/morphsnakes/blob/master/morphsnakes.py#L208 ?

I see the Ellipsoid function but I'm not exactly sure how any of this works

Dale-Black
@Dale-Black
I guess, what I am asking is how would I initialize an array for something like active contours using LazySets.jl? The Ball2 function seems to be what I want, but I don't know how to continue after creating b = Ball2(zeros(2), 1.)
Marcelo Forets
@mforets
Hi @Dale-Black, hmm i'm not aware of applications of LazySets in image segmentation problems.
Dale-Black
@Dale-Black
Thanks for your reply @mforets, is there any reason LazySets couldnt be utilized for these types of problems or are there any libraries out there better suited for this? Just want to double check before building from scratch? Specifically, just looking for the initial level set initialization like the link i posted above
Marcelo Forets
@mforets

is there any reason LazySets couldnt be utilized for these types of problems or are there any libraries out there better suited for this?

we (LazySets devs) don't work on image analysis problems like the one you indicate.

if you have questions about how to use the library for the application we're happy to help
Marcelo Forets
@mforets
ellipsoids are available in LazySets (type ?Ellipsoid)
iiuc you would have to implement ellipsoid_level_set(image_shape, E::Ellipsoid)
to get the center of E there is center, and for the semi-axes, there is no getter function i think (but it shouldn't be hard to add)
Marcelo Forets
@mforets
.. well those can be obtained directly from the (inverse) of the extremal singular values of the shape matrix ( https://tcg.mae.cornell.edu/pubs/Pope_FDA_08.pdf )
Marcelo Forets
@mforets
like this:
using LazySets, Plots, LinearAlgebra
using LazySets: center

E = Ellipsoid([1.0, 1.0], [2.0 0.0; 0.0 0.5])

vals = E |> shape_matrix |> svdvals
rmin = 1/sqrt(vals[1])
rmax = 1/sqrt(vals[end]);

rmin, rmax
(0.7071067811865475, 1.414213562373095)

b = box_approximation(E) # since E is axis-aligned, its axes match the radius of the enclosing box
Hyperrectangle{Float64, Vector{Float64}, Vector{Float64}}([1.0, 1.0], [1.414213562373095, 0.7071067811865475])
Marcelo Forets
@mforets
in fact ellipsoid_level_set receives the center and axes and creates the ellipsoid, so it is the other way round:
function ellipsoid_level_set(image_shape, center=nothing, semi_axis=nothing)

    if isnothing(center)
        center = [i/2 for i in image_shape]
    end

    if isnothing(semi_axis)
        semi_axis = [i/2 for i in image_shape]
    end

    length(center) == length(image_shape) || throw(ArgumentError("`center` and `image_shape` must have the same length."))

    length(semi_axis) == length(image_shape) || throw(ArgumentError("`semi_axis` and `image_shape` must have the same length."))

    rx, ry = semi_axis
    return Ellipsoid(center, Diagonal([rx^2, ry^2]))
end
Dale-Black
@Dale-Black
Thank you! I’ll be working on utilizing LazySets for all of the various ways to initialize a level set now!
Marcelo Forets
@mforets
:thumbsup: if you get those "snake" plots let us know!
Dale-Black
@Dale-Black
Is there a way to convert a LazySets type like Ellipsoid to an array? Say, a binary array or something similar?
Marcelo Forets
@mforets
what would the array represent?
if a region is inside the ellipsoid or not?

that can be done with the membership function:

E = Ellipsoid([1.0, 1.0], [2.0 0.0; 0.0 0.5])
B = box_approximation(E)
Bs = split(B, [30, 30])

res = [center(Bi) ∈ E for Bi in Bs]
M = reshape(res, (30, 30))

produces

plot(E)
plot!(Bs)
Marcelo Forets
@mforets
Screenshot from 2021-07-01 00-37-46.png
and the M matrix is
30×30 Matrix{Bool}:
 0  0  0  0  0  0  0  0  0  0  0  1  11  0  0  0  0  0  0  0  0  0  0  0
 0  0  0  0  0  0  0  0  1  1  1  1  1     1  1  1  1  0  0  0  0  0  0  0  0
 0  0  0  0  0  0  0  1  1  1  1  1  1     1  1  1  1  1  0  0  0  0  0  0  0
 0  0  0  0  0  1  1  1  1  1  1  1  1     1  1  1  1  1  1  1  0  0  0  0  0
 0  0  0  0  1  1  1  1  1  1  1  1  1     1  1  1  1  1  1  1  1  0  0  0  0
 0  0  0  1  1  1  1  1  1  1  1  1  11  1  1  1  1  1  1  1  1  0  0  0
 0  0  0  1  1  1  1  1  1  1  1  1  1     1  1  1  1  1  1  1  1  1  0  0  0
 0  0  1  1  1  1  1  1  1  1  1  1  1     1  1  1  1  1  1  1  1  1  1  0  0
 0  1  1  1  1  1  1  1  1  1  1  1  1     1  1  1  1  1  1  1  1  1  1  1  0
 0  1  1  1  1  1  1  1  1  1  1  1  1     1  1  1  1  1  1  1  1  1  1  1  0
 0  1  1  1  1  1  1  1  1  1  1  1  11  1  1  1  1  1  1  1  1  1  1  0
 1  1  1  1  1  1  1  1  1  1  1  1  1     1  1  1  1  1  1  1  1  1  1  1  1
 1  1  1  1  1  1  1  1  1  1  1  1  1     1  1  1  1  1  1  1  1  1  1  1  1
 ⋮              ⋮              ⋮        ⋱        ⋮              ⋮           
 1  1  1  1  1  1  1  1  1  1  1  1  1     1  1  1  1  1  1  1  1  1  1  1  1
 0  1  1  1  1  1  1  1  1  1  1  1  1     1  1  1  1  1  1  1  1  1  1  1  0
 0  1  1  1  1  1  1  1  1  1  1  1  11  1  1  1  1  1  1  1  1  1  1  0
 0  1  1  1  1  1  1  1  1  1  1  1  1     1  1  1  1  1  1  1  1  1  1  1  0
 0  0  1  1  1  1  1  1  1  1  1  1  1     1  1  1  1  1  1  1  1  1  1  0  0
 0  0  0  1  1  1  1  1  1  1  1  1  1     1  1  1  1  1  1  1  1  1  0  0  0
 0  0  0  1  1  1  1  1  1  1  1  1  1     1  1  1  1  1  1  1  1  1  0  0  0
 0  0  0  0  1  1  1  1  1  1  1  1  11  1  1  1  1  1  1  1  0  0  0  0
 0  0  0  0  0  1  1  1  1  1  1  1  1     1  1  1  1  1  1  1  0  0  0  0  0
 0  0  0  0  0  0  0  1  1  1  1  1  1     1  1  1  1  1  0  0  0  0  0  0  0
 0  0  0  0  0  0  0  0  1  1  1  1  1     1  1  1  1  0  0  0  0  0  0  0  0
 0  0  0  0  0  0  0  0  0  0  0  1  1     1  0  0  0  0  0  0  0  0  0  0  0
and
plot(E)
plot!(Bs[res])
Screenshot from 2021-07-01 00-39-58.png
Dale-Black
@Dale-Black
Yes that's exactly what I am looking for. Thanks again
Marcelo Forets
@mforets
:thumbsup:
Christian Schilling
@schillic
:O
Marcelo Forets
@mforets
in the #javis.jl stream on zulip i got feedback from the Javis developers and made a quick animation
Javis is a pure julia package to make animations
it has many features that i didn';t try yet, such as sets following a path
Marcelo Forets
@mforets

today i tried running the Lazysets docs and tests in Julia v1.6 .. and it takes no more than 2 minutes :tada:

in the past it used to take much longer i think

$ time julia --color=yes docs/make.jl  && julia --color=yes test/runtests.jl

Test Summary:     | Pass  Total
LazySets.plotting |    2      2
 21.167309 seconds (31.84 M allocations: 1.854 GiB, 2.67% gc time, 19.44% compilation time)
[ Info: SetupBuildDirectory: setting up build directory.
[ Info: Doctest: running doctests.
[ Info: Skipped ExpandTemplates step (doctest only).
[ Info: Skipped CrossReferences step (doctest only).
[ Info: Skipped CheckDocument step (doctest only).
[ Info: Skipped Populate step (doctest only).
[ Info: Skipped RenderDocument step (doctest only).
Test Summary:     | Pass  Total
LazySets.doctests |    1      1
 50.646803 seconds (79.67 M allocations: 5.673 GiB, 2.96% gc time, 4.86% compilation time)
so its 20 sec for tests and 50 sec for doctests and actually building the docs
just rebased to master the branch JuliaReach/LazySets.jl#2753
Christian Schilling
@schillic
the time you show here is just the doctests. the building happens in the first command and does not print the time (you should have gotten the result of time for everything at the very end)
also, you are only showing the time for the plot tests and doctests. there are a lot more of them
what is true is that most of the time is spent in precompilation. running the tests a second time is fast
Marcelo Forets
@mforets
:thumbsup:
Christian Schilling
@schillic
building the docs takes 5:30 and running the tests takes 11:00 on a github server
Christian Schilling
@schillic