Skip to content

About

A VTK/Qt/Julia Graphical User Interface to GMT and friends

Resources

Code of conduct

Stars

5 stars

Watchers

0 watching

Forks

Repository files navigation

InteractiveGMT

Documentation Test workflow status Coverage Docs workflow Status

Interactive 3-D viewing of GMT.jl data — grids, point clouds, and GMTfv solids / polygon meshes — in a self-contained Qt6 + VTK window. Its own Qt window, VTK render pipeline, interaction gizmo, cube axes, colour bar, shading, vertical curtains, in-window Julia console and data viewer.

Install

See more extended instructions at docs for Windows but basically, have a GMT.jl updated version and do (works on Windows11, MacOS and Linux)

using GMT

iGMTinstall()

If you do not have Julia, do this:

1- Install Julia:

2- Open the Julia console (the three colored dots icon) and type ] add GMT

3- When it finishes (it takes time), hit backscpace and do

  - using GMT
  - iGMTinstall()

At the end of the install process, use i'GMT via the desktop icon that was just created

Skip step 1 if you already have Julia installed. Skip points 1 and 2 if you already have GMT.jl installed (but it must be at least the 1.43.2 version)

EXPERIMENTAL FOR WINDOWS ONLY

If you don't have Julia installed (or have but want to use this anyway), use this installer. It will install everything for you (Julia 1.14, GMT.jl and GMT CLI), it is faster to load and saves about a 1 GB of disk space (all, but Julia, is build with MSVC and will have a rolling GMT update system).

See the Vision for where this project is headed.

Example of i'GMT in action:

i'GMT example

Quick start

Use the i'GMT icon that you now have on your desktop. Or, from a Julia REPL

using InteractiveGMT               # re-exports GMT.jl; no `using GMT` needed
G   = GMT.peaks()
fig = viz(G)                       # opens a window, returns a QtFigure handle

The call is non-blocking: it returns immediately and a Julia Timer pumps the Qt loop (~50 Hz) so the REPL stays usable while the window is open. (In a julia script.jl run with no REPL, end the script with wait_windows() to keep the process alive until the window closes.)

API

function shows
viz(G; …) a GMTgrid surface (CPT colour or image drape, vcurtain, overlays)
viz(D; …) a coloured point cloud (Ctrl+right-drag rubber-band selection)
viz(fv; …) / viz("torus"; …) a GMTfv solid / named solid / polygon mesh
viz(x; …) front-door dispatch over all of the above (iview is an alias)
add!(fig, D; …) add line/point overlays to a live grid window
add_curtain!(fig, path; …) hang a vertical image curtain (seismic / midwater profile)
show_table(fig, D) display tabular data in the window's Data Viewer tab
selection(fig) read back the rubber-band-selected point rows
isalive(fig) · save_png(path) · wait_windows() window utilities

The functions are documented in their docstrings (and, in depth, in QTVTK_PLAN.md). Each overlay/curtain is interactive: right-click for a context menu; the Scene Objects dock lists every element with a show/hide checkbox.

In-window Julia console

A Julia Console dock runs commands straight in the host session (the viewer is in-process), with fig pre-bound to that window — so add!(fig, [x y z]; mode=:points) works with no handle typed. See the docstrings / QTVTK_PLAN.md for the C++↔Julia callback mechanism.

Examples

include(joinpath(pkgdir(InteractiveGMT), "examples", "solids.jl"))
include(joinpath(pkgdir(InteractiveGMT), "examples", "curtain.jl"))   # needs network (grdcut)

About

A VTK/Qt/Julia Graphical User Interface to GMT and friends

Resources

Code of conduct

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages