Giter Club home page Giter Club logo

Comments (12)

mkborregaard avatar mkborregaard commented on August 28, 2024 1

Muarhaha I can just use the "File" menu item in Displaz, at least to view ths data. Never mind me.

from displaz.jl.

c42f avatar c42f commented on August 28, 2024 1

The package needs a new tag indeed. I've just been too embarrassed by the lack of tests to make one, but conversely too busy with other things to write proper tests!

from displaz.jl.

JoshChristie avatar JoshChristie commented on August 28, 2024 1

Hi,
You will have to change the Displaz.jl branch to #19 otherwise displaz will crash when writing types that are not Float32.

You could do something like this :)

using FileIO, LasIO, Displaz
using FixedPointNumbers
header, points = load(lazfile)
pos = Matrix{Float64}(3, length(points))
classification = Vector{UInt8}(length(points))
color = Matrix{N0f16}(3, length(points)) 
for i in linearindices(points)
    pos[1,i] = points[i].x * header.x_scale + header.x_offset
    pos[2,i] = points[i].y * header.y_scale + header.y_offset
    pos[3,i] = points[i].z * header.z_scale + header.z_offset
    classification[i] = points[i].raw_classification
    color[1,i] = points[i].red  
    color[2,i] = points[i].green
    color[3,i] = points[i].blue
end
plot3d(pos, classification = classification, color = color)

# Then manually change the displaz shader to laz points. (In displaz at the top select Shader -> Open -> las_points.glsl)

from displaz.jl.

c42f avatar c42f commented on August 28, 2024

Hi Michael,

This is a packaging issue. You should run "make install" to install displaz (see the cmake config for where this will end up on your system). I'd love to provide a downloadable package for OSX so you don't need to deal with building it at all, but unfortunately I just don't have the hardware to test it on. (I do, however accept pull requests, so if you happened to be interested in fixing that problem you could look at the osx-package branch in the displaz repo ;-) )

Regarding LASlib - I now include that with the displaz source, so you don't need to worry about it. I've tweaked the displaz README in an attempt to clarify that.

from displaz.jl.

mkborregaard avatar mkborregaard commented on August 28, 2024

Nice! that worked, thanks a lot Chris!

from displaz.jl.

mkborregaard avatar mkborregaard commented on August 28, 2024

BTW, the last example in your readme doesn't work:

julia> # Plot a pair of line series between vertices 1:2 and 3:5
       plot3d!(position, color="r", linebreak=[1,3], markershape="-", label="Example3 Lines")
ERROR: position must be a 3xN array
Stacktrace:
 [1] #plot3d#9(::String, ::Array{Float64,1}, ::String, ::String, ::Array{Int64,1}, ::Bool, ::Array{Any,1}, ::Function, ::Displaz.DisplazWindow, ::Array{SVector{3,Float64},1}) at /Users/michael/.julia/v0.6/Displaz/src/Displaz.jl:283
 [2] (::Displaz.#kw##plot3d)(::Array{Any,1}, ::Displaz.#plot3d, ::Displaz.DisplazWindow, ::Array{SVector{3,Float64},1}) at ./<missing>:0
 [3] #plot3d!#13(::Array{Any,1}, ::Function, ::Displaz.DisplazWindow, ::Array{SVector{3,Float64},1}) at /Users/michael/.julia/v0.6/Displaz/src/Displaz.jl:341
 [4] (::Displaz.#kw##plot3d!)(::Array{Any,1}, ::Displaz.#plot3d!, ::Displaz.DisplazWindow, ::Array{SVector{3,Float64},1}) at ./<missing>:0
 [5] #plot3d!#14(::Array{Any,1}, ::Function, ::Array{SVector{3,Float64},1}) at /Users/michael/.julia/v0.6/Displaz/src/Displaz.jl:346
 [6] (::Displaz.#kw##plot3d!)(::Array{Any,1}, ::Displaz.#plot3d!, ::Array{SVector{3,Float64},1}) at ./<missing>:0

julia> # mutate the color of the first two points (efficient for modifying a subset of points)
       Displaz.mutate!("Example3 Points", 1:2; color = [Gray{Float64}(1.0)])
ERROR: UndefVarError: mutate! not defined

from displaz.jl.

mkborregaard avatar mkborregaard commented on August 28, 2024

Oh and sorry if I'm being exceedingly daft, but eh how would I load the laz files into julia for plotting?

from displaz.jl.

mkborregaard avatar mkborregaard commented on August 28, 2024

@c42f I have no clue about cmake, packaging and unix installs. But I am happy to be your tester :-)

from displaz.jl.

JoshChristie avatar JoshChristie commented on August 28, 2024

Strange that the example in the readme didn't work. Which version/commit are you on? Perhaps the package needs a new tag?

To read las into julia I've been using LasIO.jl. Maybe like this :)

using FileIO, LasIO, Displaz, StaticArrays
h, points = load(lasfile)
positions = map(p -> SVector{3, Float64}((p.x * h.x_scale) + h.x_offset, (p.y * h.y_scale) + h.y_offset, (p.z * h.z_scale) + h.y_offset), points)
plot3d(positions)

from displaz.jl.

mkborregaard avatar mkborregaard commented on August 28, 2024

Thanks @JoshChristie ! It's very useful to have the data as a julia object

from displaz.jl.

mkborregaard avatar mkborregaard commented on August 28, 2024

Hey @JoshChristie I got it to work now with LasIO (on their laszip branch) but it seems the code I need is slightly different.

using FileIO, LasIO, Displaz
header, points = load(lazfile)
pos = Matrix{Float64}(3, length(points))
for i  in linearindices(points)
       pos[1,i] = points[i].x * header.x_scale + header.x_offset
       pos[2,i] = points[i].y * header.y_scale + header.y_offset
       pos[3,i] = points[i].z * header.z_scale + header.z_offset
 end
plot3d!(pos)

It all works great, but (of course) does not import all the properties of the points, such as their colour and classification. I get these when I open using displaz' window directly. Is there a way to get this information out of the header and pass to displaz? Do you intend to support Array{LasIO.LasPoint3,1} natively in the future?

from displaz.jl.

mkborregaard avatar mkborregaard commented on August 28, 2024

Nice, thank you!

from displaz.jl.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.