You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The goal of MultiScaleTreeGraph.jl is to read, write, analyse and plot MTG (Multi-scale Tree Graph) files. These files describe the plant topology (i.e. structure) along with some attributes for each node (e.g. geometry, colors, state...).
The package is under intensive development and is in a very early version. The functions may heavily change from one version to another until a more stable version is released.
1. Installation
You can install the latest stable version of MultiScaleTreeGraph.jl using this command:
] add MultiScaleTreeGraph
Or if you prefer the development version:
using Pkg
Pkg.add(url="https://github.com/VEZY/MultiScaleTreeGraph.jl", rev="master")
2. Example
Read a simple MTG file:
using MultiScaleTreeGraph
file =joinpath(dirname(dirname(pathof(MultiScaleTreeGraph))),"test","files","simple_plant.mtg")
mtg =read_mtg(file)
Then you can compute new variables in the MTG using a DataFrame.jl's alike syntax:
transform!(mtg, :Length=> (x -> x *1000.) =>:length_mm)
And then write the MTG back to disk:
write_mtg("test.mtg",mtg)
3. Conversion
You can convert an MTG into a DataFrame and select the variables you need: