umr-amap / aRchi

R package aRchi. Tree architecture from terrestrial laser scanning (TLS) data
21 stars 6 forks source link

archi2treeQSM #14

Open GakenouOF opened 11 months ago

GakenouOF commented 11 months ago

Hello @oliviermartin7,

Thank you for this excellent package.

I would like to understand the archi2treeQSM function well. Does the function convert the archi file to the same output generated in Matlab when you run TreeQSM? I am not familiar with Matlab and i have not run TreeQSM before.

However, I have used your package to create QSM which works perfectly well, and i want to extract the structural metrics from the qsm using ITSMe package (the package only recognize QSM from TreeQSM (.mat files)).

I used the archi2treeQSM function to generate a qsm in treeQSM format, then used the writeMat function from R.matlab to convert the dataframe to .mat file.

When i tried reading in the data using the ITMSe package, i get an error

Error in qsm[, , i] : incorrect number of dimensions

So, i treid using the read_QSM function in aRchi to read in the file, i also get this error

Error in data$startX : object of type 'closure' is not subsettable In addition: Warning message: In read_QSM("./output/eucs_arch2.mat", model = "treeQSM") : No QSM found

Please, kindly let me know if i misunderstood the function. It will be of great help if i can convert aRchi file to TreeQSM format

image image

Thank you.

j-miszczyszyn commented 6 months ago

Hello @oliviermartin7 I have the same questions @GakenouOF Conversion to Matlab file and integration with ITSMe package could be a powerfull tool. Best regards, Jakub

oliviermartin7 commented 6 months ago

Hello,

aRchi2treeQSM() : creates a data.table with the same order and columns names as in treeQSM. However it does not write a .mat file. This is on the to do list but I unfortunately lack of time to improve the package. But you can maybe write such a file by yourself (package R.matlab ?).

Please note that there are many functions to extract metrics from QSMs with aRchi (treebiomass, treevolume, pathfraction, WBEparameters, fork rate....).

Best,

Olivier