MathCancer / PhysiCell

PhysiCell: Scientist end users should use latest release! Developers please fork the development branch and submit PRs to the dev branch. Thanks!
http://PhysiCell.org
132 stars 92 forks source link

disconnect between Studio and C++ for custom cell functions, etc. #265

Open rheiland opened 1 month ago

rheiland commented 1 month ago

I'd welcome a discussion about this issue. In the C++ custom.cpp, create_cell_types(), we define cell types' functions. But this assumes those cell types (beyond cell_defaults) have been defined, e.g. via initialize_cell_definitions_from_pugixml. The Studio allows dynamic creation of cell types, but this only defines them in the XML. When a Copy of a cell type is created in the Studio, we somehow want it to also inherent the functions of the original cell type (or at least have that option). Actually, the issue goes beyond just wanting to copy custom cell functions.

I noticed this as a "problem" when I was playing with a potential reference model for the POSE grant where I had defined a horizontal motility vector for cell_defaults and I wanted copies of this (in the Studio) to inherent the same motility vector. More recently, I've been experimenting with a new custom_division_function which gets invoked in the divide() function. Once again, it works fine for the cell_defaults, but not for any copied cell type.

drbergman commented 1 month ago

Isn't this the purpose of the parent attribute for cell types? That's what I assume these lines were written for: https://github.com/MathCancer/PhysiCell/blob/3d7051f167b6b3551296a4b6d93db742dc532ee6/core/PhysiCell_cell.cpp#L1920-L1940

Could we just add a way to set the parent type in studio and be good on this?