Skip to content

Add support for user-defined SVG colors for cell types in PhysiCell settings#52

Merged
drbergman merged 1 commit into
my-physicellfrom
my-pc/feature-paint-by-user-colors
Jun 17, 2026
Merged

Add support for user-defined SVG colors for cell types in PhysiCell settings#52
drbergman merged 1 commit into
my-physicellfrom
my-pc/feature-paint-by-user-colors

Conversation

@drbergman

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 16, 2026 23:50
@drbergman
drbergman force-pushed the my-pc/feature-paint-by-user-colors branch from 8e924fb to 177c55a Compare June 16, 2026 23:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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> into PhysiCell_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.

Comment thread modules/PhysiCell_pathology.cpp
Comment thread modules/PhysiCell_settings.cpp
Comment thread modules/PhysiCell_pathology.cpp
Comment thread modules/PhysiCell_pathology.cpp
Comment thread modules/PhysiCell_pathology.h
Comment thread sample_projects_physipkpd/moa_apoptosis/config/pkpd_model.xml
Comment thread sample_projects_physipkpd/combo/config/pkpd_model.xml
Comment thread config/PhysiCell_settings.xml
@drbergman
drbergman force-pushed the my-pc/feature-paint-by-user-colors branch from 177c55a to 8324454 Compare June 17, 2026 00:02
@drbergman
drbergman merged commit a8e27be into my-physicell Jun 17, 2026
85 of 208 checks passed
@drbergman
drbergman deleted the my-pc/feature-paint-by-user-colors branch June 17, 2026 00:02
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.

2 participants