Open-source dendrochronology software that uses SVG sketches of tree rings
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
input/examples
interactive_sorting
output
.gitignore
LICENSE.txt
README.rst
andysSVGpathTools.py
andysmod.py
area4rings.py
debugtools.py
findT0T1.py
fixsvg.py
misc4rings.py
noIntersections4rings.py
options4rings.py
rings4rings.py
smoothing4rings.py
sorting4rings.py
svg2rings.py
svgtree.py
toposort.py
transects4rings.py

README.rst

SVG Dendro (formerly SVGTree)

SVG Dendro is open-source dendrochronology software which takes in an SVG sketch of tree rings and returns the areas of the rings, computer generated transects, and more.

Input Data Format

SVGTree can take in any svg sketch drawn using paths of Bezier curves (and/or lines, polylines, and polygons) on the following two conditions:

  1. There must be a closed path surrounding a blue line. The midpoint of this line will be used as the starting point of all transects.
  2. There must be a closed path surrounding all other paths.

In other words, the inner-most ring and the outer-most ring must be closed loops and there should be a blue line inside the inner-most ring to mark where the transects will start.

To Run

  1. Follow the instructions below to install any prerequisites needed.
  2. Download and unzip SVG Dendro.
  3. Move some SVG files you want to extract information from to the input folder (found inside the SVG Dendro folder that you just unzipped).
  4. Open a terminal/command-prompt, navigate into the SVG Dendro folder and enter the following command (without the $).

$ python svgtree.py -i input/examples/real_examples/

This will extract data from any SVG files in the <SVG Dendro Folder>/input/examples/real_examples folder and store output (by default, areas, and 50 evenly space transects) in the <SVG Dendro Folder>/output folder.

Options

To increase/decrease the number of transects found, use the -n <number> flag

$ python svgtree.py -n 500

To turn off area calculations, use the -a flag

$ python svgtree.py -n 500 -a

To specify the input/output directories:

$ python svgtree.py -i "your_svg_file.svg" -o "your_desired_output_directory"

For more basic options, enter the command:

$ python svgtree.py -h

For advanced options, read through the file "options4rings.py".

Prerequisites

  • python 2.x
  • numpy
  • scipy
  • svgwrite
  • svgpathtools

Setup

  1. Get Python 2.

Note: If you have a Mac or are running Linux, you already have Python 2.x. If you're on Windows, go download Python 2 and install it.

  1. Install the necessary python packages.

Note: This is easy using pip (which typically comes with Python). Just open up a terminal/command-prompt and enter the following four commands (without the $).

$ pip install numpy

$ pip install scipy

$ pip install svgwrite

$ pip install svgpathtools

For help

Contact me, AndyAPort@gmail.com

Licence

This module is under a MIT License.