Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added custom functions to plot the agent SVG and legend #162

Merged
merged 2 commits into from
Jul 26, 2023

Conversation

vincent-noel
Copy link
Collaborator

For PhysiMeSS, we need new design for our fibers in the svg files (a rectangle). To achieve this, we need to modify both the plotting of the svg plot, and of its legend.

This PR introduce custom functions for the plotting of the SVG agent and of the agent's legend. The existing functions are now inside standard functions, and are still used automatically. But users now have the choice to choose a different function to plot them, by modifying the function pointer inside the Cell_Functions data structure.

@MathCancer
Copy link
Owner

I really like what you have here! And I see the logic for it.

But if at all possible, I don’t think plotting belongs in PhysiCell_phenotype.cpp and Cell_Functions. I wonder: is it possible to move it closer to PhysiCell_pathology.cpp

I guess I can see where you want to make how a cell is plotted part of the cell, so that differnt cells can be plotted different ways. that’s really clever.

I can see in the future we may want ot define this at the “type” level (as part of teh Cell_Definition . I’m not super keen on mixing visualization with actual cell biology, but I can see why it’s done here. Can we thikn if there’s a workaround?

For example a std::map between a Cell_Definition* and a SVG_plot_function ? (and by default, that map is our standard SVG plot cell?)

@MathCancer
Copy link
Owner

I admit this is cumbersome. We coudl auto-create the map by altering the constructor for Cell_Definition

but I fear the mess. Hmm

@MathCancer
Copy link
Owner

MathCancer commented Jul 26, 2023

Let's approve this for now, but let's please consider a future revision that separates plotting from visualization. Thanks, @vincent-noel !

@MathCancer MathCancer merged commit 62d361b into MathCancer:development Jul 26, 2023
@furkankurtoglu
Copy link
Contributor

furkankurtoglu commented Jul 28, 2023

Hello @vincent-noel

ode-energy-sample model crashes at SVG_plot() function at following line.
https://github.com/MathCancer/PhysiCell/blob/development/sample_projects_intracellular/ode/ode_energy/main.cpp#L146

my_coloring_function is doing colorization based on custom_data which you may find here.
https://github.com/MathCancer/PhysiCell/blob/development/sample_projects_intracellular/ode/ode_energy/custom_modules/custom.cpp#L270

My question how can I accommodate this new SVG_plot() in 'ode-energy-sample' model?

And, I don't know, actually, this is the where I can ask this question. Sorry! If there is another discussion that I can ask this question.

Thank you!

@vincent-noel
Copy link
Collaborator Author

Hi @furkankurtoglu. I can look into this in a few hours. Which branch should I look at ? Is it already merged in the development branch ?

@vincent-noel
Copy link
Collaborator Author

I found the problem, and proposed this fix : #186

@furkankurtoglu
Copy link
Contributor

It works! Thank you very much, @vincent-noel!

@vincent-noel vincent-noel deleted the feat/custom_svg branch July 31, 2023 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants