Closed Helveg closed 3 years ago
@JustasB is it OK if we call the old blenderneuron.section.Section
a Branch
instead? Sounds more spatially and avoids confusion when working with the Neuron RPC
Yes we can call it Branch
When the positional properties like the x_vector of a Section or the position/rotation of a Cell is written to, Blender should update, and when it is read we should read from the Blender object, rather than keeping the coords somewhere on the object (should half our memory consumption ;p )
So I like the idea of optimizing mem usage -- this becomes even more important with larger models.
One thing to keep in mind is that there are other features in BN (that I use when constructing the OB model) that rely on being able to quickly switch between different display views of a cell group (e.g. change interaction level from cell to section and back, or save a particular 3d state as JSON "view").
At the expense of increased mem usage, I stored the section hierarchy/coords in an internal version ("a model from MVC"), which could be displayed as different views ("views from MVC"). When cells were modified within a view, the coords from that view format could be read back into the internal format, and then translated back to any other view format.
To preserve flexibility AND reduce mem usage, maybe the internal representation could be stored on HDD instead of internally in Blender's mem?
Ok, I don't mind storing it in file, I think it will be mostly the same as using the data stored in Blender, so once I get to that point I'll do some profiling and benchmarking to see how both approaches scale!
I'm going to start simple and create a
Cell
class that is constructed from an iterable of rootSection
s (orBranch
es if we want to sound less NEURON-y). Other functionality that now exists can be added on later, I think therefor it's best that I merge to anext
branch ;pThe
blenderneuron
module should contain a_cells
attribute that stores them and the following functions:create_section(x_vector, y_vector, z_vector, radii)
(is not represented in Blender until part of a cell)create_cell(roots)
(creates the 3d structure)remove_cell(cell)
/cell.remove()
Any calls to blenderlike stuff should be done from functions within the
_blender.controller
Next step will be to give both the
Cell
and theSection
some fancy properties; When the positional properties like thex_vector
of a Section or the position/rotation of aCell
is written to, Blender should update, and when it is read we should read from the Blender object, rather than keeping thecoords
somewhere on the object (should half our memory consumption ;p )