Skip to content

Commit 8764a58

Browse files
authored
Merge pull request #44 from elmbeech/main
update physicell install instruction and rename custom.cpp set_microenv to add_substrate.
2 parents fa3ab33 + 0d461fa commit 8764a58

13 files changed

+730
-14
lines changed

man/HOWTO_physicell.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
To install PhysiCell, please follow the instruction written for your operating system:
44

5-
+ [Linux](https://github.com/Dante-Berth/PhysiGym/blob/main/man/physicell_setup_poweruser_linux_v20250227a.pdf) 🐧
6-
+ [MacOSX](https://github.com/Dante-Berth/PhysiGym/blob/main/man/physicell_setup_poweruser_apple_v20250227a.pdf) 🍐
5+
+ [Linux](https://github.com/Dante-Berth/PhysiGym/blob/main/man/physicell_install_linux.md) 🐧
6+
+ [MacOSX](https://github.com/Dante-Berth/PhysiGym/blob/main/man/physicell_install_apple.md) 🍐
77
+ [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/install) 🪟
88

man/TUTORIAL_physigym_model.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ for (int i = 0 ; i < all_cells->size(); i++) {
131131

132132
1.5 Edit the *custom_modules/custom.cpp* file.
133133

134-
We will need a function that will update the microenvironment with the drug we add.
135-
At the bottom of the file, add this function to update the microenvironment.
134+
We will need a function that can add substrate (drug) to the microenvironment.
135+
At the bottom of the file, add this function.
136136

137137
```C++
138-
int set_microenv(std::string s_substrate, double r_dose) {
138+
int add_substrate(std::string s_substrate, double r_dose) {
139139
// update substrate concentration
140140
int k = microenvironment.find_density_index(s_substrate);
141141
for (unsigned int n=0; n < microenvironment.number_of_voxels(); n++) {
@@ -152,7 +152,7 @@ At the bottom of the file, add the fresh implemented function.
152152
153153
```C++
154154
// add substrate
155-
int set_microenv(std::string s_substrate, double r_dose);
155+
int add_substrate(std::string s_substrate, double r_dose);
156156
```
157157

158158

@@ -173,7 +173,7 @@ After the commented-out action example code, at *line 259*, inserts the followin
173173

174174
```C++
175175
// add drug
176-
set_microenv("drug", parameters.doubles("drug_dose"));
176+
add_substrate("drug", parameters.doubles("drug_dose"));
177177
```
178178
179179
2.2 Edit the custom_modules/extending/physicellmodule.cpp file for observation.

man/physicell_install_apple.md

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
# Setup PhysiCell on macOS
2+
3+
We will install everything PhysiCell related under the src folder that we will place in your home directory.
4+
If you prefer another folder name, please adjust the commands accordingly.
5+
6+
7+
## &#x1F34E; Operating system dependencies.
8+
9+
### &#x2728; Install Brew:
10+
11+
Follow the instruction to download and install brew.
12+
Basically, copy the installation command, paste it into the Terminal (found at Applications / Utilities), and press the enter key.
13+
14+
+ https://brew.sh/
15+
16+
Don't forget to put brew under your $PATH.
17+
18+
```bash
19+
if ! grep -Fq '/opt/homebrew/bin' ~/.zshrc
20+
then
21+
echo 'export PATH=/opt/homebrew/bin:$PATH' >> ~/.zshrc
22+
fi
23+
if ! grep -Fq '/opt/homebrew/bin' ~/.bash_profile
24+
then
25+
echo 'export PATH=/opt/homebrew/bin:$PATH' >> ~/.bash_profile
26+
fi
27+
if ps -p $$ | grep zsh
28+
then
29+
source ~/.zshrc
30+
else
31+
source ~/.bash_profile
32+
fi
33+
```
34+
35+
### &#x2728; Install GCC, ImageMagick, and FFmpeg (required by PhysiCell):
36+
37+
```bash
38+
brew install gcc imagemagick ffmpeg
39+
```
40+
41+
42+
## &#x1F34E; Basic PhyiCell installation
43+
44+
### &#x2728; Install PhysiCell:
45+
46+
Copy the installation command, paste it into the Terminal (found at Applications / Utilities), and press the enter key.
47+
48+
```bash
49+
if [ -d ~/src/PhysiCell ]
50+
then
51+
echo "ERROR : /Users/$USER/src/PhysiCell already exists! please delete the folder if you want to do a reinstallation. installation terminated."
52+
else
53+
mkdir -p ~/src
54+
cd ~/src
55+
if ! grep -Fq 'export PHYSICELL_CPP=' ~/.zshrc
56+
then
57+
echo export PHYSICELL_CPP=$(bash -c "compgen -c" | grep -m 1 -e '^g++-[0-9]\+') >> ~/.zshrc
58+
fi
59+
if ! grep -Fq 'export PHYSICELL_CPP=' ~/.bash_profile
60+
then
61+
echo export PHYSICELL_CPP=$(bash -c "compgen -c" | grep -m 1 -e '^g++-[0-9]\+') >> ~/.bash_profile
62+
fi
63+
if ps -p $$ | grep zsh
64+
then
65+
source ~/.zshrc
66+
else
67+
source ~/.bash_profile
68+
fi
69+
curl -L https://github.com/MathCancer/PhysiCell/archive/refs/tags/$(curl https://raw.githubusercontent.com/MathCancer/PhysiCell/master/VERSION.txt).zip > download.zip
70+
unzip download.zip
71+
rm download.zip
72+
rm -fr PhysiCell
73+
mv PhysiCell-$(curl https://raw.githubusercontent.com/MathCancer/PhysiCell/master/VERSION.txt) PhysiCell
74+
fi
75+
```
76+
77+
### &#x2728; Test the PhyiCell installation with the template sample project:
78+
79+
```bash
80+
cd ~/src/PhysiCell
81+
```
82+
```bash
83+
make template
84+
```
85+
```bash
86+
make -j8
87+
```
88+
```bash
89+
./project
90+
```
91+
```bash
92+
make jpeg
93+
```
94+
```bash
95+
make gif
96+
```
97+
```bash
98+
make movie
99+
```
100+
101+
102+
## &#x1F34E; Essential installation
103+
104+
We will generate a python3 environment with the default python installation, where we will install all PhysiCell modelling related python libraries.
105+
We will name this python3 environment pcvenv (PhysiCell virtual environment).
106+
107+
### &#x2728; Install PhysiCell-Studio:
108+
109+
Copy the installation command, paste it into the Terminal (found at Applications / Utilities), and press the enter key.
110+
111+
```bash
112+
if [ -d ~/src/PhysiCell-Studio ]
113+
then
114+
echo "ERROR : /Users/$USER/src/PhysiCell-Studio already exists! please delete the folder if you want to do a reinstallation. installation terminated."
115+
else
116+
cd ~/src
117+
python3 -m venv pcvenv
118+
if ! grep -Fq 'alias pcvenv=' ~/.zshrc
119+
then
120+
echo "alias pcvenv=\"source /Users/$USER/src/pcvenv/bin/activate\"" >> ~/.zshrc
121+
fi
122+
if ! grep -Fq 'alias pcvenv=' ~/.bash_profile
123+
then
124+
echo "alias pcvenv=\"source /Users/$USER/src/pcvenv/bin/activate\"" >> ~/.bash_profile
125+
fi
126+
source /Users/$USER/src/pcvenv/bin/activate
127+
curl -L https://github.com/PhysiCell-Tools/PhysiCell-Studio/archive/refs/tags/v$(curl https://raw.githubusercontent.com/PhysiCell-Tools/PhysiCell-Studio/refs/heads/main/VERSION.txt).zip > download.zip
128+
unzip download.zip
129+
rm download.zip
130+
rm -fr PhysiCell-Studio
131+
mv PhysiCell-Studio-$(curl https://raw.githubusercontent.com/PhysiCell-Tools/PhysiCell-Studio/refs/heads/main/VERSION.txt) PhysiCell-Studio
132+
pip3 install -r PhysiCell-Studio/requirements.txt
133+
cd ~/src/pcvenv/bin/
134+
echo "python3 /Users/$USER/src/PhysiCell-Studio/bin/studio.py \$*" > pcstudio
135+
chmod 775 pcstudio
136+
cd ~/src
137+
fi
138+
```
139+
140+
### &#x2728; Test the PhysiCell-Studio installation:
141+
142+
```bash
143+
cd ~/src/PhysiCell
144+
pcvenv
145+
pcstudio
146+
```
147+
148+
### &#x2728; Official PhysiCell Studio manual:
149+
150+
+ https://github.com/PhysiCell-Tools/Studio-Guide/tree/main
151+
152+
153+
## &#x1F34E; Advanced installation
154+
155+
### &#x2728; Install PhysiCell Data Loader (pcdl) and iPython:
156+
157+
```bash
158+
pcvenv
159+
pip3 install pcdl ipython
160+
```
161+
### &#x2728; Test the pcdl installation:
162+
163+
```bash
164+
ipython
165+
```
166+
```python
167+
import pcdl
168+
```
169+
```python
170+
exit()
171+
```
172+
173+
### &#x2728; Official pcdl manual:
174+
175+
+ https://github.com/PhysiCell-Tools/python-loader
176+
177+
178+
## &#x1F34F; IDE VSCode integration (optional)
179+
180+
1. Install vs code, either from your operating system’s app store or from https://code.visualstudio.com/ .
181+
182+
2. Generate a vs code profile for physicell:
183+
184+
```
185+
File | New Window with Profile
186+
Name: physicell
187+
Icon: choose something cool.
188+
Create
189+
Add Folder: Users/<username>/src
190+
click the profile icon (default is a gearwheel) on the left side bottom corner.
191+
Profile > physicell
192+
```
193+
194+
3. Open the Folder:
195+
196+
```
197+
File | Open Folder… | src | Open
198+
Yes, I trust the authors
199+
```
200+
201+
4. Install the official python and C++ extensions into the profile:
202+
203+
```
204+
click the profile icon (default is a gearwheel) on the left side bottom corner.
205+
Profile > physicell
206+
Extension: Python Install
207+
Extension: C/C++ Install
208+
```
209+
210+
5. Link pcvenv (the python environment we generated above):
211+
212+
```
213+
View | Command Palette… | Python: Select Interpreter |
214+
Enter interpreter path… | Find… | src/pcvenv
215+
```

0 commit comments

Comments
 (0)