nat
nat copied to clipboard
teach xform to scale neuron diameter when appropriate
Although neurons can easily be scaled with both points/radius information xform
and friends (e.g. xform_brain
currently can only transform point locations.
My first thought was that including a function in a reglist
object would solve this. But that doesn't work because xform eventually hands off to xformpoints and that only deals with 3D point information.
My next thought was to provide a specialised xform.neuron
method and to have that intercept the case when reg
is a function (see 2993a4b2291c8cadda295eeef85db53de3e71e43). That sort of works, but fails when reg is actually a reglist object (one of whose elements is a function).
Adding further specialised logic to xform.neuron
to handle reglist
type registrations by peeking inside them feels very inelegant.
Perhaps one could add xformneuron.reglist
and have that sort out the logic applying transforms. But that's actually pretty close to what I just mentioned and would largely duplicate xformpoints.reglist
.
Maybe we need a different class of transform that signals that it can be applied to Nx4 points and will scale diameters accordingly. But that still implies that we need some logic to inspect a reglist
and decide what to do.