Open dokato opened 3 years ago
Thanks for pointing this out. It is a units problem. symmetric_manc wants coordinates in microns but these coords are in raw voxels. Given how different they are I think we could probably add some logic inside symmetric_manc
to guess. Even better would be a reusable function that did this any time we wanted to use xyzmatrix. Perhaps something like this:
manc_xyzmatrix<-function(x, inunits=c("guess", "raw", "microns"), outunits=c("in", "raw", "microns"), ...) {
}
Better still would be general units support for nat!
Actually, what happened here is
after <- symmetric_manc(before/125)
but indeed, the division does not apply to X,Y,Z. As I always forget what data you need to divide by what, I'll have a look at units support soon.
There is special handling for attached metadata data.frames for xform.neuronlist
https://github.com/natverse/nat/blob/master/R/xform.R#L209-L228
however it is controlled by an argument since it would be possible to have XYZ metadata columns that you didn't want to be touched.
*.neuronlist
is much simpler:
https://github.com/natverse/nat/blob/2da55fa227666471d0231b90dde0fe565a519860/R/neuronlist.R#L945
it should probably be translated to Ops.neuronlist but implement Ops is slightly more complicated. Here is the implementation for Ops.neuron
https://github.com/natverse/nat/blob/88507a819c2b4b4f16ada74a79560abc4d260fc5/R/neuron.R#L345
we would either need to
*.neuronlist
and +.neuronlist
and have it always on, or relegate more complex scaling operations to scale.neuronlist
or scale.neuron
.
What is?
After calling
symmetric_manc
soma coordinates become NA:Expected behaviour
Soma positions become symmetrised too.