umr-amap / aRchi

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

Convert Skeletor SWC format to archi tree skeleton #12

Closed davodogster closed 1 year ago

davodogster commented 1 year ago

Hi @oliviermartin7

I have a tree skeleton with edges and vertices like this in SWC Skeletor (github) format: image

Do you think it's easy to convert it to the aRchi skeleton format so we can derive tree params/architecture metrics from it? Please let me know if you can assist or have suggestions.

Cheers, Sam

oliviermartin7 commented 1 year ago

Hi Sam,

Yes could work ! I suggest you use model= "simpletree" with _readQSM function. Your input has to be like this :

startX; startY ; startZ ; endX ; endY ; radius ; axis_ID; branching_order

Be consistent with the colum order. _axisID and _branchingorder can be 0 and will be recalculated when using build_archi function.

Best

Olivier

davodogster commented 1 year ago

I notice no 'endZ' so is that not required? @oliviermartin7 My second Q is we also have the skeleton in MTG format. https://mtg.readthedocs.io/en/latest/user/intro.html#mtg-file Do you think it's possible to do the same with MTG to aRchi?

I will plan to try this.

Thank you! Sam

oliviermartin7 commented 1 year ago

@davodogster. oups ! You're right I forgot the z. So it is:

startX; startY ; startZ ; endX ; endY ; endZ; radius ; axis_ID; branching_order

For MTG, it is something we have to do for a while but we did not yet... If you are keen to code it would be awesome to add it to aRchi !!

Best,

Olivier

@VEZY

VEZY commented 1 year ago

Yes I didn't have time to get into this yet. @davodogster you can look into this repo for the MTG format: https://github.com/VEZY/XploRer/

You can read an MTG, and then extract its content as a data.frame with data.tree::ToDataFrameTree. An example is given here.

The full doc is here: https://vezy.github.io/XploRer/index.html

Keep in mind this package is currently in a stale state because R is too slow for heavy computations, so I rapidly switched to Julia and developed this package instead. So XploRer lacks a lot of features compared to MultiScaleTreeGraph.jl.

oliviermartin7 commented 1 year ago

Thanks a lot Rémi for the information @VEZY !!