A visual tool for defining cellular populations through boolean spatial functions and generating MorpheusML-compatible XML output.
CellMapper solves the problem of initializing equally-sized cells within geometrically defined regions and outputting them as a CellPopulation
for Morpheus models.
Use the GUI to define up to 3 different spatial equations that can be combined using standard set operators (union, intersection, difference).
Important: Equations must use valid Python syntax (e.g., x**2 + y**2 > 30
).
The output is a valid CellPopulation
XML that can be copied directly into a Morpheus model using the 'Copy to Clipboard' button. A real-time visualization shows each cell cluster in a different color for instant verification.
Here is a screenshot of how the program looks like:
CellMapper addresses the challenge of creating connected cell populations with roughly equal sizes and user-specified cell counts. This is an instance of the graph clustering problem, which is NP-hard .
We use the established METIS library and its Python wrapper pymetis to solve the cell initialization problem through intelligent graph partitioning.
Built with:
- 3D support - Currently limited to 2D grids
- Code consistency - Formatting and style need standardization
- Error handling - Needs robust validation for user input
- Grid types - Only supports rectangular grids (hexagonal grids planned)
Fork or download the contents of the repo and then run:
# Navigate to the project directory
cd cellmapper
# Install required dependencies
pip install PySide6 lxml pymetis numpy clipboard
# Run the application
python main.py
LLMs were used in this project to:
- help translate the GUI from pysimplegui to PySide6.
- to debug the visualization of the cells.
- to clean up and optimize the README