natverse / nat

NeuroAnatomy Toolbox: An R package for the (3D) visualisation and analysis of biological image data, especially tracings of single neurons.
https://natverse.org/nat/
64 stars 29 forks source link

[WIP] units #498

Open dokato opened 2 years ago

dokato commented 2 years ago

I decided to include my first attempts to suport units in nat (#470) for reference.

I used units package and implemented assignement of units to XYZW columns of a d matrix.

Known problems:

> class(pnu) <- c(class(pnu), "units")
> pnu
'neuron' with 180 vertices in 1 tree and additional classes 'units'
> pnu + set_units(3,'um')
> set_units(pn)
Error in UseMethod("set_units") : 
  no applicable method for 'set_units' applied to an object of class "c('neuron', 'list')"

Happy to take some pointers.

TODO: