Skip to content

Commit 8726b7b

Browse files
committed
Updated PhysiBoSS sample projects
1 parent 3bc1d73 commit 8726b7b

4 files changed

Lines changed: 23 additions & 23 deletions

File tree

sample_projects_intracellular/boolean/cancer_invasion/custom_modules/custom.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,24 +129,24 @@ void create_cell_types( void )
129129
This is a good place to set custom functions.
130130
*/
131131

132-
cell_defaults.functions.pre_update_intracellular = pre_update_intracellular;
133-
cell_defaults.functions.post_update_intracellular = post_update_intracellular;
132+
cell_defaults.phenotype.intracellulars[0]->pre_update_intracellular = pre_update_intracellular;
133+
cell_defaults.phenotype.intracellulars[0]->post_update_intracellular = post_update_intracellular;
134134

135135
cell_defaults.functions.update_phenotype = phenotype_function;
136136
cell_defaults.functions.custom_cell_rule = custom_function;
137137
cell_defaults.functions.contact_function = contact_function;
138138

139139
Cell_Definition* pCD = find_cell_definition( "epithelial");
140140

141-
pCD->functions.pre_update_intracellular = pre_update_intracellular;
142-
pCD->functions.post_update_intracellular = post_update_intracellular;
141+
pCD->phenotype.intracellulars[0]->pre_update_intracellular = pre_update_intracellular;
142+
pCD->phenotype.intracellulars[0]->post_update_intracellular = post_update_intracellular;
143143
pCD->functions.custom_cell_rule = custom_function;
144144
pCD->functions.contact_function = contact_function;
145145
pCD->functions.update_velocity = standard_update_cell_velocity;
146146

147147
pCD = find_cell_definition( "mesenchymal");
148-
pCD->functions.pre_update_intracellular = pre_update_intracellular;
149-
pCD->functions.post_update_intracellular = post_update_intracellular;
148+
pCD->phenotype.intracellulars[0]->pre_update_intracellular = pre_update_intracellular;
149+
pCD->phenotype.intracellulars[0]->post_update_intracellular = post_update_intracellular;
150150
pCD->functions.custom_cell_rule = custom_function;
151151
pCD->functions.contact_function = contact_function;
152152
pCD->functions.update_velocity = standard_update_cell_velocity;
@@ -301,11 +301,11 @@ void contact_function( Cell* pMe, Phenotype& phenoMe , Cell* pOther, Phenotype&
301301
return;
302302
}
303303

304-
void pre_update_intracellular(Cell* pCell, Phenotype& phenotype, double dt){
304+
void pre_update_intracellular(Cell* pCell, Phenotype& phenotype, Intracellular* intracellular, double dt){
305305
return;
306306
}
307307

308-
void post_update_intracellular(Cell* pCell, Phenotype& phenotype, double dt){
308+
void post_update_intracellular(Cell* pCell, Phenotype& phenotype, Intracellular* intracellular, double dt){
309309
return;
310310
}
311311

sample_projects_intracellular/boolean/cancer_invasion/custom_modules/custom.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ inline double get_motility_amplitude( double percent )
9797
void contact_function( Cell* pMe, Phenotype& phenoMe , Cell* pOther, Phenotype& phenoOther , double dt );
9898

9999
void add_ecm_interaction( Cell* pCell, int index_ecm, int index_voxel );
100-
void pre_update_intracellular(Cell* pCell, Phenotype& phenotype, double dt);
101-
void post_update_intracellular(Cell* pCell, Phenotype& phenotype, double dt);
100+
void pre_update_intracellular(Cell* pCell, Phenotype& phenotype, Intracellular* intracellular, double dt);
101+
void post_update_intracellular(Cell* pCell, Phenotype& phenotype, Intracellular* intracellular, double dt);
102102

103103
std::string my_coloring_function_for_stroma( double concentration, double max_conc, double min_conc );
104104
void color_node(Cell* pCell);

sample_projects_intracellular/boolean/physiboss_cell_lines/custom_modules/custom.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ void create_cell_types( void )
9595
cell_defaults.functions.update_velocity = NULL;
9696
cell_defaults.functions.update_phenotype = NULL;
9797
cell_defaults.functions.update_migration_bias = NULL;
98-
cell_defaults.functions.pre_update_intracellular = pre_update_intracellular;
99-
cell_defaults.functions.post_update_intracellular = post_update_intracellular;
10098
cell_defaults.functions.custom_cell_rule = NULL;
10199

102100
cell_defaults.functions.add_cell_basement_membrane_interactions = NULL;
@@ -115,6 +113,8 @@ void create_cell_types( void )
115113
116114
This is a good place to set custom functions.
117115
*/
116+
PhysiCell::cell_definitions_by_name["last_one"]->phenotype.intracellulars[0]->pre_update_intracellular = pre_update_intracellular;
117+
PhysiCell::cell_definitions_by_name["last_one"]->phenotype.intracellulars[0]->post_update_intracellular = post_update_intracellular;
118118

119119
/*
120120
This builds the map of cell definitions and summarizes the setup.
@@ -158,26 +158,26 @@ void setup_tissue( void )
158158
load_cells_from_pugixml();
159159
}
160160

161-
void pre_update_intracellular( Cell* pCell, Phenotype& phenotype, double dt )
161+
void pre_update_intracellular( Cell* pCell, Phenotype& phenotype, Intracellular* intracellular, double dt )
162162
{
163163
if (PhysiCell::PhysiCell_globals.current_time >= 100.0
164-
&& pCell->phenotype.intracellular->get_parameter_value("$time_scale") == 0.0
164+
&& intracellular->get_parameter_value("$time_scale") == 0.0
165165
){
166-
pCell->phenotype.intracellular->set_parameter_value("$time_scale", 0.1);
166+
intracellular->set_parameter_value("$time_scale", 0.1);
167167
}
168168

169169
}
170170

171-
void post_update_intracellular( Cell* pCell, Phenotype& phenotype, double dt )
171+
void post_update_intracellular( Cell* pCell, Phenotype& phenotype, Intracellular* intracellular, double dt )
172172
{
173-
color_node(pCell);
173+
color_node(pCell, intracellular);
174174
}
175175

176176
std::vector<std::string> my_coloring_function( Cell* pCell )
177177
{
178178
std::vector< std::string > output( 4 , "rgb(0,0,0)" );
179179

180-
if ( !pCell->phenotype.intracellular->get_boolean_variable_value( parameters.strings("node_to_visualize") ) )
180+
if ( !pCell->phenotype.intracellulars[0]->get_boolean_variable_value( parameters.strings("node_to_visualize") ) )
181181
{
182182
output[0] = "rgb(255,0,0)";
183183
output[2] = "rgb(125,0,0)";
@@ -191,7 +191,7 @@ std::vector<std::string> my_coloring_function( Cell* pCell )
191191
return output;
192192
}
193193

194-
void color_node(Cell* pCell){
194+
void color_node(Cell* pCell, Intracellular* intracellular){
195195
std::string node_name = parameters.strings("node_to_visualize");
196-
pCell->custom_data[node_name] = pCell->phenotype.intracellular->get_boolean_variable_value(node_name);
196+
pCell->custom_data[node_name] = intracellular->get_boolean_variable_value(node_name);
197197
}

sample_projects_intracellular/boolean/physiboss_cell_lines/custom_modules/custom.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ void setup_microenvironment( void );
8484
std::vector<std::string> my_coloring_function( Cell* );
8585

8686
// custom cell phenotype functions could go here
87-
void pre_update_intracellular( Cell* pCell, Phenotype& phenotype, double dt );
88-
void post_update_intracellular( Cell* pCell, Phenotype& phenotype, double dt );
89-
void color_node(Cell* pCell);
87+
void pre_update_intracellular( Cell* pCell, Phenotype& phenotype, Intracellular* intracellular, double dt );
88+
void post_update_intracellular( Cell* pCell, Phenotype& phenotype, Intracellular* intracellular, double dt );
89+
void color_node(Cell* pCell, Intracellular* intracellular);
9090

9191
#endif

0 commit comments

Comments
 (0)