Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help with osx installation #21

Closed
mkborregaard opened this issue Aug 14, 2017 · 12 comments
Closed

help with osx installation #21

mkborregaard opened this issue Aug 14, 2017 · 12 comments

Comments

@mkborregaard
Copy link

Hi, I'm having trouble getting this installed on OS X.
I updated docutils and cmake, cloned the displaz repo, and ran the OS X instructions in the .travis.yml file. Everything seemed to go smoothly. I then installed the Displaz.jl package.

I had to export PATH=/Users/michael/Documents/github/displaz/build/bin:$PATH in order for julia to find displaz. Now I get the displaz window opening with plot3d!(10*randn(3,100000)), but lots of error messages:

OpenGL implementation:
  GL_VENDOR    = Intel Inc.
  GL_RENDERER  = Intel(R) Iris(TM) Graphics 6100
  GL_VERSION   = 4.1 INTEL-10.25.17
  GLSL_VERSION = 4.10
  GLEW_VERSION = 2.0.0
ERROR: Could not read cursor shader.
ERROR: Could not read axes shaders
ERROR: Could not read grid shader.
ERROR: Couldn't open shader file "shaders:las_points.glsl": No such file or directory
ERROR: Couldn't open shader file "generic_points.glsl": No such file or directory
/var/folders/b8/rvm2dk495f74088ssh9v2l8r0000gn/T/julia88Butv.ply: float[3] position
/var/folders/b8/rvm2dk495f74088ssh9v2l8r0000gn/T/julia88Butv.ply: float[3] color
/var/folders/b8/rvm2dk495f74088ssh9v2l8r0000gn/T/julia88Butv.ply: float[1] markersize
/var/folders/b8/rvm2dk495f74088ssh9v2l8r0000gn/T/julia88Butv.ply: int32_t[1] markershape
Loaded 100000 of 100000 points from file /var/folders/b8/rvm2dk495f74088ssh9v2l8r0000gn/T/julia88Butv.ply in 0.13 seconds

Do I need to add more things to PATH?

Also, the installation instructions say I need LASlib to open .las files, but the link does not provide any installation instructions. You may not be able to help with this, just checking that I should be able to work this on my Mac? (it seems very windows-specific).

Thanks!

@c42f
Copy link
Owner

c42f commented Aug 15, 2017

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.

@c42f c42f closed this as completed Aug 15, 2017
@mkborregaard
Copy link
Author

Nice! that worked, thanks a lot Chris!

@mkborregaard
Copy link
Author

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

@mkborregaard
Copy link
Author

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

@mkborregaard
Copy link
Author

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

@mkborregaard
Copy link
Author

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

@JoshChristie
Copy link
Contributor

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)

@c42f
Copy link
Owner

c42f commented Aug 16, 2017

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!

@mkborregaard
Copy link
Author

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

@mkborregaard
Copy link
Author

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?

@JoshChristie
Copy link
Contributor

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)

@mkborregaard
Copy link
Author

Nice, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants