03 - Computree

Export voxels

is there a possibility to export generated voxels of a tree in a way that it can be loaded into R or Matlab and includes the voxel values?I tried the option under “Export - Voxel - 3D grids, table (X,Y,Z,Value)” as well as “3D grids, ASCII”. Both options did not work for an import into another software.

I know this option and as well as the option to calculate/generate voxels directly in Matlab.What I wanted is to use the voxels which are generated in Computree anyway as part of the processing chain. So to say to reduce amount of different workflows.

For small ones you can use something like : read.table(filename.GRD3D, dec=“.”, sep="\t”). For bigger ones you should probably use data.table and fread.

In this table you have (x,y,z) of the lower left corner of each cell, (x,y,z) of the center of each cell and the integer indices of the cells along x, y and z axis (colx, rowy, levz). Indices begin at 0 for the first cell.With that you can easily create any structure you want in R or matlab.

The “3D grids, ASCII” is inspired from raster format, so would need a more dedicated reading code.

At the beginning you have the header giving numbers of x columns, y rows, and z levels. following that you have the coordinates of the lower left corner of the grid, the cell size and the no_data coding value.

After that you have the values of the grid, Z plane by Z plane (from lowest z value to highest z value).Between each plane there is an empty line.For each plane you have one line for each Y row (from HIGHEST y value to LOWEST y value). Y is stored in inverse order (top to bottom), to be consistent with raster classical logic (image paradigm). For each line you have one value for each X column (from lowest x value to highest x value), separated by tabulations (\t).

These formats have been created because we didn’t know “standards” existing formats for grids. If you have a precise format in mind you would like to use, we could add it in Computree.If it is the case, please let me know which one(s), and give me a reference (link or document) where to find the format specification. We would like to enrich import / export capacities of Computree for grids. So any suggestion will be considered with interest.