Add support for user-defined SVG colors for cell types in PhysiCell settings#52
Merged
Merged
Conversation
drbergman
force-pushed
the
my-pc/feature-paint-by-user-colors
branch
from
June 16, 2026 23:57
8e924fb to
177c55a
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a configuration-driven way to override SVG cell coloring by cell type name in PhysiCell settings, while keeping automatic palette assignment (and extending it beyond the original fixed palette size).
Changes:
- Introduces
<cell_colors><cell_color name="...">...</cell_color></cell_colors>parsing under<SVG>intoPhysiCell_Settings. - Updates
paint_by_number_cell_coloring()to (a) honor user-specified colors, (b) skip user-claimed palette colors, and (c) generate additional colors via golden-angle HSV spacing. - Adds commented XML documentation blocks describing the new setting across multiple sample/unit-test configs.
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
modules/PhysiCell_settings.h |
Adds state to store whether SVG cell colors were specified and the name→color map. |
modules/PhysiCell_settings.cpp |
Parses <cell_colors> under <SVG> into settings. |
modules/PhysiCell_pathology.h |
Adds includes needed for new SVG color validation / processing helpers. |
modules/PhysiCell_pathology.cpp |
Validates user-provided colors, assigns per-cell-type colors (palette + HSV generation), and uses them in SVG output. |
config/PhysiCell_settings.xml |
Adds a commented example/documentation block for the new <cell_colors> option. |
sample_projects/immune_function/config/PhysiCell_settings.xml |
Adds a commented example/documentation block for the new <cell_colors> option. |
sample_projects_intracellular/boolean/physiboss_cell_lines/config/PhysiCell_settings.xml |
Adds a commented example/documentation block for the new <cell_colors> option. |
unit_tests/custom_DCs_2substrates/config/PhysiCell_settings.xml |
Adds a commented example/documentation block for the new <cell_colors> option. |
sample_projects_physipkpd/template_pkpd/config/pkpd_model.xml |
Adds a commented example/documentation block for the new <cell_colors> option. |
sample_projects_physipkpd/moa_proliferation/config/pkpd_model.xml |
Adds a commented example/documentation block for the new <cell_colors> option. |
sample_projects_physipkpd/moa_necrosis/config/pkpd_model.xml |
Adds a commented example/documentation block for the new <cell_colors> option. |
sample_projects_physipkpd/moa_motility/config/pkpd_model.xml |
Adds a commented example/documentation block for the new <cell_colors> option. |
sample_projects_physipkpd/moa_apoptosis/config/pkpd_model.xml |
Adds a commented example/documentation block for the new <cell_colors> option. |
sample_projects_physipkpd/confluence_start-deprecated/config/pkpd_model.xml |
Adds a commented example/documentation block for the new <cell_colors> option. |
sample_projects_physipkpd/combo/config/pkpd_model.xml |
Adds a commented example/documentation block for the new <cell_colors> option. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
drbergman
force-pushed
the
my-pc/feature-paint-by-user-colors
branch
from
June 17, 2026 00:02
177c55a to
8324454
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.