MaCS4Plants

MultiScaleTreeGraph.jl

Purpose

The goal of MultiScaleTreeGraph.jl is to read, write, analyse and plot MTG (Multi-scale Tree Graph) files.

The Multi-Scale Tree Graph, or MTG, is a data structure used to encode a plant to describe its topology (i.e. structure) and any attributes (e.g. geometry, colours, state…). It was developed in the AMAP lab in the 90’s to cope with the need of a generic yet scalable structure for plant topology and traits measurement, analysis and modelling.

The format is described in details in the original paper from Godin et Caraglio (1998) .

The MTG format helps describe the plant at different scales at the same time. For example we can describe a plant at the scale of the organ (e.g. leaf, internode), the scale of a growth unit, the scale of the axis, the crown or even at the whole plant.

You can find out how to use the package on the Getting started section, or more about the MTG format in the The MTG concept .

This package is heavily inspired by OpenAlea’s MTG implementation in Python.

Try it !

Start by creating a new environment for your project using the pkg manager. To enter the package manager, just press ] in the REPL, and it will become blue (press backspace to return to the Julia REPL). Then create the environment using this command:

activate .

Don’t forget the “.”! It is used to tell the pkg manager that you activate the project were you currently are.

You can then install PlantBiophysics using this command (still from the pkg manager):

add MultiScaleTreeGraph

Example

Here is an example usage with a simulation of the energy balance and assimilation of a leaf:

using MultiScaleTreeGraph

# Use an MTG from the package tests:
file = joinpath(dirname(dirname(pathof(MultiScaleTreeGraph))),"test","files","simple_plant.mtg")

# Read the file:
mtg = read_mtg(file)

# Compute a nwe variable "length_mm" that will define the node length in mm instead of m based on the current variable "Length":
transform!(mtg, :Length => (x -> x * 1000.) => :length_mm)

# Write the new mtg to disk:
write_mtg("test.mtg",mtg)

# Transform into a DataFrame, selecting only some attributes ("length_mm" and "XX"):
DataFrame(mtg, [:length_mm, :XX])

For a more extensive documentation and tutorials, please head over the official documentation website .

LICENSE

This package is distributed under the MIT license. A full description of the license can be found here .

Reference

On internet

Find us