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

Make SVG plots with substrates easier and more configurable #204

Conversation

drbergman
Copy link
Collaborator

Two main changes being suggested here:

  1. Make SVG plots with substrates easier: Add the substrate_coloring_function to the template main.cpp and pass it into the three calls to SVG_plot so that all projects starting from there can include the substrate plot in SVGs just by configuring via xml or studio. If it is not set, SVG_plot already cleverly ignores all this, even if not specified. In other words, it should not cause errors.
  2. Make SVG plots with substrates more configurable: Allow users to specify the colormap used in plotting the substrate in SVGs. Options include all those included in studio as well as their reverse values. Marco Ruscone's original colormap is included as original. Default, however, is YlOrRd. The list of colormap names is then {"original","YlOrRd","viridis","turbo","jet","plasma"} as well as any of these with a "_r" appended to indicate it is reversed.

Minor change: substrate_coloring_function originally returned a vector of 4 strings, probably because it started from the cell_coloring_function template which uses four colors. However, only one of substrate_coloring_function were used, so that is now reflected in the code.

Most of the lines added are simply the specifications for turbo, jet, and plasma. These have higher resolution because it was when I was adding those that I realized I could easily get Matlab to print out what I needed to specify these colormaps to arbitrary precision. If you edit in VS Code like a 21st century human, you can fold these out of view. Dinosaurs and vim users, I hope your editor-of-choice can do that.

Suggestions are welcome!

If accepted, this will be followed up with corresponding updates to studio.

drbergman and others added 11 commits October 20, 2021 11:21
Created `set_substrate_dirichlet_activation_vector` to set the `dirichlet_activation_vector` for microenvironment to be the same as for default_microenvironment but not change the `dirichlet_activation_vectors` that track Dirichlet activations for each substrate at each voxel. With this change PhysiCell can robustly and adaptively track which substrates have DCs at any given voxel without further user setup.
added `set_substrate_dirichlet_activation_vector` to class Microenvironment
Fixed random orientation vector selection by using the standardized UniformOnUnitSphere function. Before, the z-value was uniform on [-1,1] which is not the desired uniformity.
@MathCancer
Copy link
Owner

@vincent-noel and @marcorusc Do you anticipate any unexpected effects from this PR? I know that Marco in particular worked a lot on backgroudn coloring functions.

@drbergman
Copy link
Collaborator Author

Follow up: the implementation in studio is already done and passed preliminary testing (just me).

Also, I guess I felt like throwing shade at the end there...not sure what prompted that. Sorry to all involved!

@vincent-noel
Copy link
Collaborator

It looks very good to me : more options, simplification of the substrate_coloring_function.

Looking at the list of commits, maybe you need to rebase your branch ? seems like many commits are not related to this change (and there are modifications in the readme which probably shouldn't be there).

I need to test it, to triple check the existing examples still work, but again, thanks @drbergman, this is nice.

@drbergman
Copy link
Collaborator Author

I just earned the rebase level 1 badge (did my first rebase). Not sure if I used it correctly, but I'd be happy to do so here if that will help in this setting.

I can go ahead and make sure the readme is the dev branch readme. I probably started from the main branch...

@drbergman
Copy link
Collaborator Author

And since I'll be making changes to this anyways, I'll include the fix in #216

@vincent-noel
Copy link
Collaborator

Good ! If everything looks good, then you need to force push the rebased branch, and we should see the list of commits updated (and reduced). Let me know if something goes wrong, I can try to help.

This extends the functionality of plotting substrate heatmaps on SVG output:
* Allows for all colormaps permitted in studio for visualizing substrate concentrations
* Allows for configuration of this heatmap in the XML configuration file
* updates all sample projects so that they can use this functionality just by enabling SVG substrate plots in the XML
@drbergman drbergman force-pushed the feature-more-svg-substrate-colormaps-with-xml branch from 5e6c006 to 151e1c6 Compare March 5, 2024 15:04
@drbergman
Copy link
Collaborator Author

the easier solution (for me) was to create a new branch and then create a new PR. seemed safer than trying to make this work and possibly breaking things. See my new PR #219

@drbergman drbergman closed this Mar 5, 2024
@drbergman drbergman deleted the feature-more-svg-substrate-colormaps-with-xml branch March 5, 2024 17:48
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